DrupalErrorCollectionUnitTest::assertError

7 common.test DrupalErrorCollectionUnitTest::assertError($error, $group, $function, $file, $message = NULL)

Assert that a collected error matches what we are expecting.

File

modules/simpletest/tests/common.test, line 2164
Tests for common.inc functionality.

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(drupal_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)));
  }
}
Login or register to post comments