You are here

function DrupalErrorCollectionUnitTest::assertError in SimpleTest 7

Assert that a collected error matches what we are expecting.

1 call to DrupalErrorCollectionUnitTest::assertError()
DrupalErrorCollectionUnitTest::testErrorCollect in tests/common.test
Test that simpletest collects errors from the tested site.

File

tests/common.test, line 1510
Tests for common.inc functionality.

Class

DrupalErrorCollectionUnitTest
Tests Simpletest error and exception collector.

Code

function assertError($error, $group, $function, $file, $message = NULL) {
  $this
    ->assertEqual($error['group'], $group, t("Group was %group", array(
    '%group' => $group,
  )));
  $this
    ->assertEqual($error['caller']['function'], $function, t("Function was %function", array(
    '%function' => $function,
  )));
  $this
    ->assertEqual(basename($error['caller']['file']), $file, t("File was %file", array(
    '%file' => $file,
  )));
  if (isset($message)) {
    $this
      ->assertEqual($error['message'], $message, t("Message was %message", array(
      '%message' => $message,
    )));
  }
}