You are here

function SimpleTestTest::getTestIdFromResults in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/Tests/SimpleTestTest.php \Drupal\simpletest\Tests\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
Contains \Drupal\simpletest\Tests\SimpleTestTest.

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

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