diff --git a/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php
index d48c6f2..0bb8bd3 100644
--- a/core/lib/Drupal/Core/Database/Database.php
+++ b/core/lib/Drupal/Core/Database/Database.php
@@ -489,6 +489,15 @@ public static function convertDbUrlToConnectionInfo($url, $root) {
     if (isset($info['port'])) {
       $database['port'] = $info['port'];
     }
+
+    if (isset($info['query'])) {
+      $parts = array();
+      parse_str($info['query'], $parts);
+      if (isset($parts['namespace'])) {
+        $database['namespace'] = $parts['namespace'];
+      }
+    }
+
     return $database;
   }
 
@@ -525,6 +534,9 @@ public static function getConnectionInfoAsUrl($key = 'default') {
     if ($db_info['default']['prefix']['default']) {
       $db_url .= '#' . $db_info['default']['prefix']['default'];
     }
+    if (isset($db_info['default']['namespace'])) {
+      $db_url .= '?namespace=' . $db_info['default']['namespace'];
+    }
     return $db_url;
   }
 
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index b994352..bb9c114 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -184,7 +184,7 @@ function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames
     // Something broke during the execution of phpunit.
     // Return an error record of all failed classes.
     $rows[] = [
-      'test_id' => '1',
+      'test_id' => $test_id,
       'test_class' => implode(",", $unescaped_test_classnames),
       'status' => 'fail',
       'message' => 'PHPunit Test failed to complete',
@@ -316,7 +316,7 @@ function simpletest_phpunit_command() {
   if (substr(PHP_OS, 0, 3) == 'WIN') {
     $php_executable_finder = new PhpExecutableFinder();
     $php = $php_executable_finder->find();
-    $phpunit_bin = escapeshellarg($php) . ' -f ' . escapeshellarg($vendor_dir . '/phpunit/phpunit/composer/bin/phpunit') . ' --';
+    $phpunit_bin = escapeshellarg($php) . ' -f ' . escapeshellarg($vendor_dir . '/phpunit/phpunit/phpunit') . ' --';
   }
   else {
     $phpunit_bin = $vendor_dir . '/phpunit/phpunit/phpunit';
