diff -u b/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php --- b/core/lib/Drupal/Core/Database/Database.php +++ b/core/lib/Drupal/Core/Database/Database.php @@ -517,7 +517,10 @@ $host = isset($db_info['default']['host']) ? $db_info['default']['host'] : 'localhost'; // Create a URI with the minimum requirement of driver://host/database. - $uri = new Uri($db_info['default']['driver'] . '://' . $host . '/' . $db_info['default']['database']); + $uri = new Uri(); + $uri = $uri->withScheme($db_info['default']['driver']) + ->withHost($host) + ->withPath($db_info['default']['database']); if (!empty($db_info['default']['prefix']['default'])) { $uri = $uri->withFragment($db_info['default']['prefix']['default']); reverted: --- b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php +++ a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php @@ -48,9 +48,6 @@ * @covers ::getDatabaseConnectionInfo */ public function testGetDatabaseConnectionInfoWithOutManualSetDbUrl() { - if (Database::getConnection()->driver() == 'sqlite') { - $this->markTestSkipped('SQLITE modifies the prefixes so we cannot effectively test it'); - } $options = $this->container->get('database')->getConnectionOptions(); $this->assertSame($this->databasePrefix, $options['prefix']['default']); }