You are here

function _simpletest_batch_finished in SimpleTest 7

Same name and namespace in other branches
  1. 8.3 simpletest.module \_simpletest_batch_finished()
  2. 6.2 simpletest.module \_simpletest_batch_finished()
  3. 7.2 simpletest.module \_simpletest_batch_finished()
1 string reference to '_simpletest_batch_finished'
simpletest_run_tests in ./simpletest.module
Actually runs tests.

File

./simpletest.module, line 223
Provides testing functionality.

Code

function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
  if ($success) {
    drupal_set_message(t('The test run finished in @elapsed.', array(
      '@elapsed' => $elapsed,
    )));
  }
  else {

    // Use the test_id passed as a parameter to _simpletest_batch_operation().
    $test_id = $operations[0][1][1];

    // Retrieve the last database prefix used for testing and the last test
    // class that was run from. Use the information to read the lgo file
    // in case any fatal errors caused the test to crash.
    list($last_prefix, $last_test_class) = simpletest_last_test_get($test_id);
    simpletest_log_read($test_id, $last_prefix, $last_test_class);
    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');
  }
  module_invoke_all('test_group_finished');
}