1 simpletest.module simpletest_last_test_get($test_id)

Get information about the last test that ran given a test ID.

Parameters

$test_id: The test ID to get the last test from.

Return value

Array containing the last database prefix used and the last test class: that ran.

File

core/modules/simpletest/simpletest.module, line 282
Provides testing functionality.

Code

function simpletest_last_test_get($test_id) {
  $last_prefix = db_query_range('SELECT prefix FROM {simpletest_prefix} WHERE test_id = :test_id', 0, 1, array(':test_id' => $test_id))->fetchField();
  $last_test_class = db_query_range('SELECT test_class FROM {simpletest} WHERE test_id = :test_id ORDER BY message_id DESC', 0, 1, array(':test_id' => $test_id))->fetchField();
  return array($last_prefix, $last_test_class);
}