diff -u b/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
--- b/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -11,6 +11,7 @@
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Config\BootstrapConfigStorageFactory;
 use Drupal\Core\Database\ConnectionNotDefinedException;
+use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
 use Drupal\Core\Logger\RfcLogLevel;
 use Drupal\Core\Test\TestDatabase;
 use Drupal\Core\Session\AccountInterface;
@@ -554,18 +555,24 @@
  *   The name of the current user's timezone or the name of the default timezone.
  */
 function drupal_get_user_timezone() {
-  $user = \Drupal::currentUser();
-  $config = \Drupal::config('system.date');
-
-  if ($user && $config->get('timezone.user.configurable') && $user->isAuthenticated() && $user->getTimezone()) {
-    return $user->getTimezone();
-  }
-  else {
-    // Ignore PHP strict notice if time zone has not yet been set in the php.ini
-    // configuration.
+  try {
+    $user = \Drupal::currentUser();
+    $config = \Drupal::config('system.date');
+    if ($user && $config->get('timezone.user.configurable') && $user->isAuthenticated() && $user->getTimezone()) {
+      return $user->getTimezone();
+    }
     $config_data_default_timezone = $config->get('timezone.default');
-    return !empty($config_data_default_timezone) ? $config_data_default_timezone : @date_default_timezone_get();
+    if (!empty($config_data_default_timezone)) {
+      return $config_data_default_timezone;
+    }
   }
+  catch (ContainerNotInitializedException $e) {
+    // Noop.
+  }
+
+  // Ignore PHP strict notice if time zone has not yet been set in the php.ini
+  // configuration.
+  return @date_default_timezone_get();
 }
 
 /**
only in patch2:
unchanged:
--- a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
+++ b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
@@ -58,7 +58,6 @@ public function setUp() {
     }
     // Get a lock and a valid site path.
     $this->testDb = new TestDatabase();
-    include $this->root . '/core/includes/bootstrap.inc';
   }
 
   /**
only in patch2:
unchanged:
--- a/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php
@@ -26,8 +26,6 @@ class ExtensionSerializationTest extends UnitTestCase {
    * @covers ::__wakeup
    */
   public function testServiceAppRouteUsage() {
-    // The assumption of our test is that DRUPAL_ROOT is not defined.
-    $this->assertFalse(defined('DRUPAL_ROOT'), 'Constant DRUPAL_ROOT is defined.');
     $container = new ContainerBuilder();
     // Set a dummy container app.root to test against.
     $container->set('app.root', '/dummy/app/root');
