[FrameworkBundle] Stop calling Kernel::boot() twice in cli

This commit is contained in:
Robin Chalas 2018-12-09 20:16:27 +01:00
parent 7b03bff57a
commit 97e15fe1b5
2 changed files with 4 additions and 4 deletions

View File

@ -62,16 +62,14 @@ class Application extends BaseApplication
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
$this->kernel->boot();
$this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher'));
$this->registerCommands();
if ($this->registrationErrors) {
$this->renderRegistrationErrors($input, $output);
}
$this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher'));
return parent::doRun($input, $output);
}

View File

@ -204,6 +204,7 @@ class ApplicationTest extends TestCase
$container->setParameter('console.command.ids', array(ThrowingCommand::class => ThrowingCommand::class));
$kernel = $this->getMockBuilder(KernelInterface::class)->getMock();
$kernel->expects($this->once())->method('boot');
$kernel
->method('getBundles')
->willReturn(array($this->createBundleMock(
@ -256,6 +257,7 @@ class ApplicationTest extends TestCase
;
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel->expects($this->once())->method('boot');
$kernel
->expects($this->any())
->method('getBundles')