function SimpleTestTest::assertAssertion in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/simpletest/src/Tests/SimpleTestTest.php \Drupal\simpletest\Tests\SimpleTestTest::assertAssertion()
Asserts that an assertion with specified values is displayed in results.
Parameters
string $message Assertion message.:
string $type Assertion type.:
string $status Assertion status.:
string $file File where the assertion originated.:
string $function Function where the assertion originated.:
Return value
Assertion result.
1 call to SimpleTestTest::assertAssertion()
- 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 300 - 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\TestsCode
function assertAssertion($message, $type, $status, $file, $function) {
$message = trim(strip_tags($message));
$found = FALSE;
foreach ($this->childTestResults['assertions'] as $assertion) {
if (strpos($assertion['message'], $message) !== FALSE && $assertion['type'] == $type && $assertion['status'] == $status && $assertion['file'] == $file && $assertion['function'] == $function) {
$found = TRUE;
break;
}
}
return $this
->assertTrue($found, format_string('Found assertion {"@message", "@type", "@status", "@file", "@function"}.', array(
'@message' => $message,
'@type' => $type,
'@status' => $status,
"@file" => $file,
"@function" => $function,
)));
}