You are here

function simpletest_last_test_get in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/simpletest.module \simpletest_last_test_get()

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 Array containing the last database prefix used and the last test class that ran.

1 call to simpletest_last_test_get()
_simpletest_batch_finished in core/modules/simpletest/simpletest.module
Implements callback_batch_finished().

File

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

Code

function simpletest_last_test_get($test_id) {
  $last_prefix = TestBase::getDatabaseConnection()
    ->queryRange('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = :test_id', 0, 1, array(
    ':test_id' => $test_id,
  ))
    ->fetchField();
  $last_test_class = TestBase::getDatabaseConnection()
    ->queryRange('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,
  );
}