diff -u b/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php --- b/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -1090,9 +1090,10 @@ */ protected function initializeRequestGlobals(Request $request) { global $base_url; + // Set and derived from $base_url by this function. global $base_path, $base_root; global $base_secure_url, $base_insecure_url; - + // Create base URL. $base_path = $request->getBasePath(); // Requests to 'core/foo.php' bypass the front controller, causing // $request->getBasePath() to return a string ending with '/core'. In these diff -u b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php --- b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php +++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php @@ -13,7 +13,7 @@ * @group DrupalKernel */ class DrupalKernelTest extends UnitTestCase { - + //Back up and restore any global variables that may be changed by tests. protected $backupGlobals = FALSE; /**