1 simpletest.test SimpleTestFunctionalTest::assertAssertion($message, $type, $status, $file, $function)

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.:

File

core/modules/simpletest/tests/simpletest.test, line 228
Tests for simpletest.module.

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