You are here

function SimpleTestFunctionalTest::assertAssertion in SimpleTest 7

Same name and namespace in other branches
  1. 6.2 simpletest.test \SimpleTestFunctionalTest::assertAssertion()
  2. 7.2 simpletest.test \SimpleTestFunctionalTest::assertAssertion()

Assert that an assertion with the specified values is displayed in the test results.

Parameters

string $message Assertion message.:

string $type Assertion type.:

string $status Assertion status.:

string $file File where the assertion originated.:

string $functuion Function where the assertion originated.:

Return value

Assertion result.

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

File

./simpletest.test, line 186

Class

SimpleTestFunctionalTest

Code

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, t('Found assertion {"@message", "@type", "@status", "@file", "@function"}.', array(
    '@message' => $message,
    '@type' => $type,
    '@status' => $status,
    "@file" => $file,
    "@function" => $function,
  )));
}