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

Assert that a collected error matches what we are expecting.

File

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

Class

CommonSimpleTestErrorCollectorTestCase
Tests SimpleTest error and exception collector.

Code

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