Пример #1
0
 public static function earlyInitialize()
 {
     $classLoader = new UniversalClassLoader();
     $classLoader->registerNamespace('Stagehand\\TestRunner', array(__DIR__ . '/../../..', __DIR__ . '/../../../../examples'));
     $classLoader->registerPrefix('Stagehand_TestRunner_', __DIR__ . '/../../../../examples');
     $classLoader->register();
     self::$applicationContext = new TestApplicationContext();
     self::$applicationContext->setComponentFactory(new TestComponentFactory());
     self::$applicationContext->setEnvironment(new self());
     self::$applicationContext->setPlugin(PluginRepository::findByPluginID(PHPUnitPlugin::getPluginID()));
     ApplicationContext::setInstance(self::$applicationContext);
     $container = new Container();
     $transformation = new Transformation($container);
     $transformation->transformToContainerParameters();
     ApplicationContext::getInstance()->getComponentFactory()->setContainer($container);
 }
Пример #2
0
 protected function configureApplicationContext()
 {
     $environment = new Environment();
     $environment->setWorkingDirectoryAtStartup(function_exists('Stagehand\\TestRunner\\Core\\workingDirectoryAtStartup') ? workingDirectoryAtStartup() : $GLOBALS['STAGEHAND_TESTRUNNER_workingDirectoryAtStartup']);
     $environment->setPreloadScript(function_exists('Stagehand\\TestRunner\\Core\\preloadScript') ? preloadScript() : $GLOBALS['STAGEHAND_TESTRUNNER_preloadScript']);
     $applicationContext = new ApplicationContext();
     $applicationContext->setComponentFactory(new ComponentFactory());
     $applicationContext->setEnvironment($environment);
     ApplicationContext::setInstance($applicationContext);
 }
Пример #3
0
 protected function configureApplicationContext()
 {
     $environment = new Environment();
     $environment->setWorkingDirectoryAtStartup(workingDirectoryAtStartup());
     $environment->setPreloadScript(preloadScript());
     $applicationContext = new ApplicationContext();
     $applicationContext->setComponentFactory(new ComponentFactory());
     $applicationContext->setEnvironment($environment);
     ApplicationContext::setInstance($applicationContext);
 }