function SimpleTestTest::getTestIdFromResults

Fetch the test id from the test results.

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

File

core/modules/simpletest/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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.