Example #1
0
 /**
  * @test
  *
  * @covers LuisMulinari\Consolefull\Application::__construct
  * @covers LuisMulinari\Consolefull\Application::doRun
  * @covers LuisMulinari\Consolefull\Application::injectContainer
  * @covers Symfony\Component\Console\Application::__construct
  * @covers Symfony\Component\Console\Application::add
  * @covers Symfony\Component\Console\Application::doRun
  * @covers Lcobucci\DependencyInjection\ContainerInjector::setContainer
  * @covers Lcobucci\DependencyInjection\ContainerInjector::getContainer
  */
 public function doRunShouldInjectTheContainerOnContainerAwareCommands()
 {
     $input = $this->getMock(InputInterface::class);
     $output = $this->getMock(OutputInterface::class);
     $container = $this->getMock(ContainerInterface::class);
     $this->builder->expects($this->never())->method('getContainer');
     $command = new CommandTest();
     $command2 = new ContainerAwareCommandTest();
     $application = new Application('name', 'version', $this->config, $this->builder);
     $application->add($command);
     $application->add($command2);
     $application->setContainer($container);
     $application->doRun($input, $output);
     $this->assertAttributeSame($container, 'container', $command2);
 }