protected function tearDown() { $this->applicationContext->getComponentFactory()->clearComponents(); ApplicationContext::getInstance()->getEnvironment()->setWorkingDirectoryAtStartup(null); ApplicationContext::getInstance()->getEnvironment()->setPreloadScript(null); ApplicationContext::setInstance($this->oldApplicationContext); }
protected function setUp() { $this->oldApplicationContext = ApplicationContext::getInstance(); $this->applicationContext = $this->createApplicationContext(); $this->applicationContext->setPlugin($this->getPlugin()); $this->applicationContext->setComponent('input', new ArgvInput()); $output = new ConsoleOutput(); $output->setDecorated(false); $this->applicationContext->setComponent('output', $output); ApplicationContext::setInstance($this->applicationContext); }
/** * @return \Stagehand\TestRunner\Core\ApplicationContext */ protected function createApplicationContext() { $containerClass = 'Stagehand\\TestRunner\\DependencyInjection\\' . $this->getPluginID() . 'Container'; $container = new $containerClass(); $componentFactory = new TestComponentFactory(); $componentFactory->setContainer($container); $applicationContext = new TestApplicationContext(); $applicationContext->setComponentFactory($componentFactory); $applicationContext->setEnvironment(new Environment()); return $applicationContext; }
/** * @return \Stagehand\TestRunner\Core\ApplicationContext */ protected function createApplicationContext() { $container = new Container(); $componentFactory = new TestComponentFactory(); $componentFactory->setContainer($container); $applicationContext = new TestApplicationContext(); $applicationContext->setComponentFactory($componentFactory); $applicationContext->setEnvironment(new TestEnvironment()); return $applicationContext; }