[FrameworkBundle] Stop calling Kernel::boot() twice in cli
This commit is contained in:
parent
7b03bff57a
commit
97e15fe1b5
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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')
|
||||
|
Reference in New Issue
Block a user