diff -u b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php --- b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php @@ -52,6 +52,7 @@ else { try { $default_backend = $container->get('database')->driver(); + $container->set('database', NULL); } catch (\Exception $e) { // If Drupal is not installed or a test doesn't define database there