Skip to content

Instantly share code, notes, and snippets.

@neclimdul
Created June 1, 2014 22:31
Show Gist options
  • Save neclimdul/5f9c06d83cf31261d8f3 to your computer and use it in GitHub Desktop.
Save neclimdul/5f9c06d83cf31261d8f3 to your computer and use it in GitHub Desktop.
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 914228e..ef2e022 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -776,6 +776,7 @@ function simpletest_phpunit_get_available_tests($module = NULL) {
// Find all the tests and get a list of unique class names.
$test_suite = $configuration->getTestSuiteConfiguration(NULL);
$test_classes = array();
+ /** @var $test_suite \PHPUnit_Framework_TestSuite[] */
foreach ($test_suite as $test) {
// PHPUnit returns a warning message if something is wrong with a test,
// throw an exception to avoid an error when trying to call getInfo() on
@@ -784,9 +785,9 @@ function simpletest_phpunit_get_available_tests($module = NULL) {
throw new RuntimeException($test->getMessage());
}
- $name = get_class($test);
+ $name = $test->getName();
if (!array_key_exists($name, $test_classes) && (!$module || substr($name, 0, $n) == $prefix)) {
- $test_classes[$name] = $test->getInfo();
+ $test_classes[$name] = $name::getInfo();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment