function DrupalErrorCollectionUnitTest::assertError

Assert that a collected error matches what we are expecting.

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

File

modules/simpletest/tests/common.test, line 2820

Class

DrupalErrorCollectionUnitTest
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(drupal_basename($error['caller']['file']), $file, format_string("File was %file", array(
        '%file' => $file,
    )));
    if (isset($message)) {
        $this->assertEqual($error['message'], $message, format_string("Message was %message", array(
            '%message' => $message,
        )));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.