diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index d4018a7..9475715 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -1199,9 +1199,6 @@ private function restoreEnvironment() { } conf_path(TRUE, TRUE); - // Restore stream wrappers of the test runner. - $this->container->get('stream_wrapper_manager')->register(); - // Restore original shutdown callbacks. $callbacks = &drupal_register_shutdown_function(); $callbacks = $this->originalShutdownCallbacks; diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 6acca33..c11ddc8 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -915,6 +915,11 @@ protected function setUp() { $this->resetAll(); $this->kernel->prepareLegacyRequest($request); + // Explicitly call register() again on the container registered in \Drupal. + // @todo This should already be called through + // DrupalKernel::prepareLegacyRequest() -> DrupalKernel::boot() but that + // appears to be calling a different container. + $this->container->get('stream_wrapper_manager')->register(); // Temporary fix so that when running from run-tests.sh we don't get an // empty current path which would indicate we're on the home page. $path = current_path();