You are here

function SimpleTestFunctionalTest::getTestIdFromResults in Drupal 7

Fetch the test id from the test results.

1 call to SimpleTestFunctionalTest::getTestIdFromResults()
SimpleTestFunctionalTest::confirmStubTestResults in modules/simpletest/simpletest.test
Confirm that the stub test produced the desired results.

File

modules/simpletest/simpletest.test, line 224
Tests for simpletest.module.

Class

SimpleTestFunctionalTest
@file Tests for simpletest.module.

Code

function getTestIdFromResults() {
  foreach ($this->childTestResults['assertions'] as $assertion) {
    if (preg_match('@^Test ID is ([0-9]*)\\.$@', $assertion['message'], $matches)) {
      return $matches[1];
    }
  }
  return NULL;
}