diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 5c99f66..583ca17 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -178,8 +178,25 @@ function simpletest_run_tests($test_list) { */ function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames) { $phpunit_file = simpletest_phpunit_xml_filepath($test_id); - simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file); - return simpletest_phpunit_xml_to_rows($test_id, $phpunit_file); + $ret = simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file); + if ($ret == ".") { + // Something broke during the execution of phpunit. + // Return an error record of all failed classes. + $rows[] = [ + 'test_id' => '1', + 'test_class' => implode(",", $unescaped_test_classnames), + 'status' => 'fail', + 'message' => 'PHPunit Test failed to complete', + 'message_group' => 'Other', + 'function' => implode(",", $unescaped_test_classnames), + 'line' => '0', + 'file' => $phpunit_file, + ]; + } + else { + $rows = simpletest_phpunit_xml_to_rows($test_id, $phpunit_file); + } + return $rows; } /**