diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 4cfc261f53148977802d84402e325f0a1df480aa..96ab21bb81b46107d0e4036be00c2697e6c85196 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -789,8 +789,8 @@ function simpletest_phpunit_get_available_tests($module = NULL) {
       }
 
       $name = $test->getName();
-      if ($test instanceof \Drupal\Tests\UnitTestCase && !array_key_exists($name, $test_classes) && (!$module || substr($name, 0, $n) == $prefix)) {
-        $test_classes[$name] = $test::getInfo();
+      if (!array_key_exists($name, $test_classes) && (!$module || substr($name, 0, $n) == $prefix)) {
+        $test_classes[$name] = $name::getInfo();
       }
     }