diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index e19aeae..42e72ff 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -515,6 +515,9 @@ protected function enableModules(array $modules) { $module_filenames = $module_handler->getModuleList(); $this->kernel->updateModules($module_filenames, $module_filenames); + // Update the container from the kernel. + $this->container = $this->kernel->getContainer(); + // Ensure isLoaded() is TRUE in order to make _theme() work. // Note that the kernel has rebuilt the container; this $module_handler is // no longer the $module_handler instance from above. @@ -548,6 +551,9 @@ protected function disableModules(array $modules) { // Update the kernel to remove their services. $this->kernel->updateModules($module_filenames, $module_filenames); + // Update the container from the kernel. + $this->container = $this->kernel->getContainer(); + // Ensure isLoaded() is TRUE in order to make _theme() work. // Note that the kernel has rebuilt the container; this $module_handler is // no longer the $module_handler instance from above.