/** * @return \TestPresenter */ private function createPresenter() { $url = new \Nette\Http\UrlScript('http://localhost/'); $url->setScriptPath('/'); $configurator = new \Nette\Config\Configurator(); $configurator->addConfig(__DIR__ . '/config.neon'); \Kdyby\Events\DI\EventsExtension::register($configurator); \Kdyby\Annotations\DI\AnnotationsExtension::register($configurator); \Kdyby\Doctrine\DI\OrmExtension::register($configurator); $container = $configurator->setTempDirectory(TEMP_DIR)->createContainer(); $container->removeService('httpRequest'); $container->addService('httpRequest', new \Nette\Http\Request($url)); $application = $container->getService('application'); $application->router[] = new \Nette\Application\Routers\SimpleRouter(); $presenter = new TestPresenter($container); $container->callInjects($presenter); $presenter->invalidLinkMode = $presenter::INVALID_LINK_WARNING; $presenter->autoCanonicalize = FALSE; return $presenter; }
protected function beforeSetUp() { ConsoleExtension::register($this->getConfigurator()); OrmExtension::register($this->getConfigurator()); EventsExtension::register($this->getConfigurator()); }