diff --git a/core/modules/hal/tests/src/Functional/Update/CreateHalSettingsForLinkDomainUpdateTest.php b/core/modules/hal/tests/src/Functional/Update/CreateHalSettingsForLinkDomainUpdateTest.php
index dbc999c9d4..5afed645c5 100644
--- a/core/modules/hal/tests/src/Functional/Update/CreateHalSettingsForLinkDomainUpdateTest.php
+++ b/core/modules/hal/tests/src/Functional/Update/CreateHalSettingsForLinkDomainUpdateTest.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\hal\Functional\Update;
 
-use Drupal\system\Tests\Update\UpdatePathTestBase;
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
 
 /**
  * Tests that 'hal.settings' is created, to store 'link_domain'.
diff --git a/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php b/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php
index 1677420752..344caf1e1c 100644
--- a/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php
+++ b/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\hal\Functional\Update;
 
-use Drupal\system\Tests\Update\UpdatePathTestBase;
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
 
 /**
  * 'link_domain' is migrated from 'rest.settings' to 'hal.settings'.
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 83d7feb699..9a03ac9e5d 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -340,8 +340,18 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun
 
   // Optimized for running a single test.
   if (count($unescaped_test_classnames) == 1) {
-    $class = new \ReflectionClass($unescaped_test_classnames[0]);
-    $command[] = escapeshellarg($class->getFileName());
+    // In order to benefit from triggered deprecation errors, we want to force
+    // our child process to do discovery. In order to optimize this a bit, we
+    // also need to minimize the discovery time, so we have to figure out the
+    // --testsuite argument.
+    $class_name = $unescaped_test_classnames[0];
+    $testsuite = TestDiscovery::$typeMap[TestDiscovery::getPhpunitTestSuite($class_name)];
+    $command = array_merge($command, [
+      '--testsuite',
+      $testsuite,
+      '--filter',
+      escapeshellarg($class_name),
+    ]);
   }
   else {
     // Double escape namespaces so they'll work in a regexp.
diff --git a/core/modules/simpletest/src/TestDiscovery.php b/core/modules/simpletest/src/TestDiscovery.php
index 5374520e56..8af9db815c 100644
--- a/core/modules/simpletest/src/TestDiscovery.php
+++ b/core/modules/simpletest/src/TestDiscovery.php
@@ -17,6 +17,18 @@
  */
 class TestDiscovery {
 
+  /**
+   * Array to help map between run-tests.sh types and PHPUnit testsuites.
+   *
+   * @var string[]
+   */
+  static public $typeMap = [
+    'Unit' => 'unit',
+    'Kernel' => 'kernel',
+    'Functional' => 'functional',
+    'FunctionalJavscript' => 'functional-javascript',
+  ];
+
   /**
    * The class loader.
    *
