/** * @test * * @covers LuisMulinari\Consoleful\Application::__construct * @covers LuisMulinari\Consoleful\Application::doRun * @covers LuisMulinari\Consoleful\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); }