Skip to content

Commit

Permalink
[FrameworkBundle] Stop calling Kernel::boot() twice in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Chalas committed Dec 9, 2018
1 parent 7b03bff commit 97e15fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,14 @@ public function getKernel()
*/
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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public function testRunOnlyWarnsOnUnregistrableCommandAtTheEnd()
$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(
Expand Down Expand Up @@ -256,6 +257,7 @@ private function getKernel(array $bundles, $useDispatcher = false)
;

$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel->expects($this->once())->method('boot');
$kernel
->expects($this->any())
->method('getBundles')
Expand Down

0 comments on commit 97e15fe

Please sign in to comment.