Exemplo n.º 1
0
 protected function tearDown()
 {
     $this->applicationContext->getComponentFactory()->clearComponents();
     ApplicationContext::getInstance()->getEnvironment()->setWorkingDirectoryAtStartup(null);
     ApplicationContext::getInstance()->getEnvironment()->setPreloadScript(null);
     ApplicationContext::setInstance($this->oldApplicationContext);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }