You are here

public function SimpleTestTest::getTestIdFromResults in SimpleTest 8.3

Fetch the test id from the test results.

1 call to SimpleTestTest::getTestIdFromResults()
SimpleTestTest::confirmStubTestResults in src/Tests/SimpleTestTest.php
Confirm that the stub test produced the desired results.

File

src/Tests/SimpleTestTest.php, line 280

Class

SimpleTestTest
Tests SimpleTest's web interface: check that the intended tests were run and ensure that test reports display the intended results. Also test SimpleTest's internal browser and APIs implicitly.

Namespace

Drupal\simpletest\Tests

Code

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