diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index dc06c87086..10ddbbce11 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -216,6 +216,9 @@ protected function setUp() { if (file_exists($directory . '/settings.testing.php')) { Settings::initialize(DRUPAL_ROOT, $site_path, $class_loader); } + // Ensure to set the module list upfront to avoid setting the kernel into + // the pre-installer mode. + $this->kernel->updateModules([], []); $this->kernel->boot(); // Ensure database install tasks have been run. @@ -231,6 +234,9 @@ protected function setUp() { // prevents any services created during the first boot from having stale // database connections, for example, \Drupal\Core\Config\DatabaseStorage. $this->kernel->shutdown(); + // Ensure to set the module list upfront to avoid setting the kernel into + // the pre-installer mode. + $this->kernel->updateModules([], []); $this->kernel->boot(); // Save the original site directory path, so that extensions in the