Issue #1986528 by Berdir: Fixed Fatal error: Call to undefined method PHPUnit_Framework_Warning::getInfo() when there is an error in tests.

8.0.x
Alex Pott 2013-07-31 07:47:37 +02:00
parent 0e6c03df64
commit 8cb7ab835a
1 changed files with 7 additions and 0 deletions

View File

@ -726,6 +726,13 @@ function simpletest_phpunit_get_available_tests() {
$test_suite = $configuration->getTestSuiteConfiguration(NULL);
$test_classes = array();
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
// this.
if ($test instanceof PHPUnit_Framework_Warning) {
throw new RuntimeException($test->getMessage());
}
$name = get_class($test);
if (!array_key_exists($name, $test_classes)) {
$test_classes[$name] = $test->getInfo();