register() public static method

public static register ( Configurator $configurator )
$configurator Nette\Configurator
コード例 #1
0
ファイル: Helper.inc.php プロジェクト: cujan/vcelyweb
 /**
  * @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;
 }
コード例 #2
0
 protected function beforeSetUp()
 {
     ConsoleExtension::register($this->getConfigurator());
     OrmExtension::register($this->getConfigurator());
     EventsExtension::register($this->getConfigurator());
 }