diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 4dbd4fd..908dcd0 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -721,7 +721,7 @@ function simpletest_script_command($test_id, $test_class) {
  * @see simpletest_script_run_one_test()
  */
 function simpletest_script_cleanup($test_id, $test_class, $exitcode) {
-  if (strpos($test_class, 'Drupal\\Tests\\') === 0) {
+  if (is_subclass_of($test_class, 'PHPUnit_Framework_TestCase')) {
     // PHPUnit test, move on.
     return;
   }
