You are here

function simpletest_result_get in SimpleTest 7

Same name and namespace in other branches
  1. 6.2 simpletest.pages.inc \simpletest_result_get()
  2. 7.2 simpletest.pages.inc \simpletest_result_get()

Get test results for $test_id.

Parameters

$test_id The test_id to retrieve results of.:

Return value

Array of results grouped by test_class.

1 call to simpletest_result_get()
simpletest_result_form in ./simpletest.pages.inc
Test results form for $test_id.

File

./simpletest.pages.inc, line 377
Page callbacks for simpletest module.

Code

function simpletest_result_get($test_id) {
  $results = db_select('simpletest')
    ->fields('simpletest')
    ->condition('test_id', $test_id)
    ->orderBy('test_class')
    ->orderBy('message_id')
    ->execute();
  $test_results = array();
  foreach ($results as $result) {
    if (!isset($test_results[$result->test_class])) {
      $test_results[$result->test_class] = array();
    }
    $test_results[$result->test_class][] = $result;
  }
  return $test_results;
}