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); }
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); }
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); }