Issue #3419230 by alexpott: Drush error on site-install
parent
577b6900b9
commit
63c3ce45b4
|
@ -695,7 +695,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
|
|||
* @return void
|
||||
*/
|
||||
public function terminate(Request $request, Response $response) {
|
||||
if ($this->getHttpKernel() instanceof TerminableInterface) {
|
||||
if ($this->booted && $this->getHttpKernel() instanceof TerminableInterface) {
|
||||
// Only run terminate() when essential services have been set up properly
|
||||
// by preHandle() before.
|
||||
if ($this->prepared === TRUE) {
|
||||
|
|
|
@ -4,12 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Drupal\Tests\Core\DrupalKernel;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Drupal\Core\DrupalKernel;
|
||||
use Drupal\Core\Test\TestKernel;
|
||||
use Drupal\Tests\Core\DependencyInjection\Fixture\BarClass;
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
use org\bovigo\vfs\vfsStream;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Drupal\Core\DrupalKernel
|
||||
|
@ -152,6 +154,16 @@ EOD;
|
|||
$this->assertEquals($container->get('kernel')->getServiceIdMapping()[$container->generateServiceIdHash($service)], 'bar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::terminate
|
||||
* @runInSeparateProcess
|
||||
*/
|
||||
public function testUnBootedTerminate() {
|
||||
$kernel = new DrupalKernel('test', new ClassLoader());
|
||||
$kernel->terminate(new Request(), new Response());
|
||||
$this->assertTrue(TRUE, "\Drupal\Core\DrupalKernel::terminate() called without error on kernel which has not booted");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue