示例#1
0
 protected function tearDown()
 {
     $this->applicationContext->getComponentFactory()->clearComponents();
     ApplicationContext::getInstance()->getEnvironment()->setWorkingDirectoryAtStartup(null);
     ApplicationContext::getInstance()->getEnvironment()->setPreloadScript(null);
     ApplicationContext::setInstance($this->oldApplicationContext);
 }
示例#2
0
 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);
 }
示例#3
0
 /**
  * @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;
 }
示例#4
0
 /**
  * @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;
 }