$message=format_plural($emailCount,t('!count e-mail was sent during this test.'),t('!count e-mails were sent during this test.'),array('!count'=>$emailCount));
drupal_set_message(t('The test run did not successfully finish.'),'error');
drupal_set_message(t('Please use the <em>Clean environment</em> button to clean-up temporary files and tables.'),'warning');
...
...
@@ -211,6 +218,21 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
module_invoke_all('test_group_finished');
}
/*
* Get information about the last test that ran given a test ID.
*
* @param $test_id
* The test ID to get the last test from.
* @return
* Array containing the last database prefix used and the last test class
* that ran.
*/
functionsimpletest_last_test_get($test_id){
$last_prefix=db_result(db_query_range('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = :test_id',array(':test_id'=>$test_id),0,1));
$last_test_class=db_result(db_query_range('SELECT test_class FROM {simpletest} WHERE test_id = :test_id ORDER BY message_id DESC',array(':test_id'=>$test_id),0,1));
returnarray($last_prefix,$last_test_class);
}
/**
* Read the error log and report any errors as assertion failures.
*
...
...
@@ -218,28 +240,39 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
* will have been recorded by the error handler.
*
* @param $test_id
* The test ID to read log file for.
* The test ID to which the log relates.
* @param $prefix
* The database prefix to which the log relates.
* @param $test_class
* The test class to which the log relates.
* @param $during_test
* Indicates that the current file directory path is a temporary file
* file directory used during testing.
* @return
* Found any entries in log.
*/
functionsimpletest_log_read($test_id){
$last_prefix=db_query('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = :test_id',array(':test_id'=>$test_id))->fetchField();
$last_prefix=substr($last_prefix,10);
$test_class=db_query('SELECT test_class FROM {simpletest} WHERE test_id = :test_id ORDER BY message_id',array(':test_id'=>$test_id))->fetchField();