Index: modules/simpletest/drupal_web_test_case.php =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v retrieving revision 1.178 diff -u -r1.178 drupal_web_test_case.php --- modules/simpletest/drupal_web_test_case.php 10 Dec 2009 15:39:43 -0000 1.178 +++ modules/simpletest/drupal_web_test_case.php 12 Dec 2009 20:32:35 -0000 @@ -402,11 +402,20 @@ } set_error_handler(array($this, 'errorHandler')); - $methods = array(); + $class = get_class($this); // Iterate through all the methods in this class. - foreach (get_class_methods(get_class($this)) as $method) { + foreach (get_class_methods($class) as $method) { // If the current method starts with "test", run it - it's a test. if (strtolower(substr($method, 0, 4)) == 'test') { + // Insert a fail record. This will be deleted on completion to ensure + // that testing completed. + $method_info = new ReflectionMethod($class, $method); + $caller = array( + 'file' => $method_info->getFileName(), + 'line' => $method_info->getStartLine(), + 'function' => $class . '->' . $method . '()', + ); + DrupalTestCase::insertAssert($this->testId, $class, FALSE, t('The test did not complete due to a fatal error.'), 'Completion check', $caller); $this->setUp(); try { $this->$method(); @@ -416,6 +425,13 @@ $this->exceptionHandler($e); } $this->tearDown(); + // Remove the Completion check. + db_delete('simpletest') + ->condition('test_id', $this->testId) + ->condition('test_class', $class) + ->condition('function', $caller['function']) + ->condition('message_group', 'Completion check') + ->execute(); } } // Clear out the error messages and restore error handler.