Public Member Functions | |
SimpleErrorQueue () | |
clear () | |
setTestCase (&$test) | |
expectError ($expected, $message) | |
add ($severity, $content, $filename, $line) | |
tally () | |
_testLatestError ($severity, $content, $filename, $line) | |
extract () | |
_extractExpectation () | |
Static Public Member Functions | |
getSeverityAsString ($severity) | |
Public Attributes | |
$_queue | |
$_expectation_queue | |
$_test | |
$_using_expect_style = false |
Definition at line 53 of file errors.php.
SimpleErrorQueue::SimpleErrorQueue | ( | ) |
Starts with an empty queue.
Definition at line 62 of file errors.php.
References clear().
SimpleErrorQueue::clear | ( | ) |
Discards the contents of the error queue. public
Definition at line 70 of file errors.php.
Referenced by SimpleErrorQueue().
SimpleErrorQueue::setTestCase | ( | &$ | test | ) |
Sets the currently running test case.
SimpleTestCase | $test Test case to send messages to. public |
Definition at line 80 of file errors.php.
SimpleErrorQueue::expectError | ( | $ | expected, | |
$ | message | |||
) |
Sets up an expectation of an error. If this is not fulfilled at the end of the test, a failure will occour. If the error does happen, then this will cancel it out and send a pass message.
SimpleExpectation | $expected Expected error match. | |
string | $message Message to display. public |
Definition at line 93 of file errors.php.
SimpleErrorQueue::add | ( | $ | severity, | |
$ | content, | |||
$ | filename, | |||
$ | line | |||
) |
Adds an error to the front of the queue.
integer | $severity PHP error code. | |
string | $content Text of error. | |
string | $filename File error occoured in. | |
integer | $line Line number of error. public |
Definition at line 106 of file errors.php.
References $content, and _testLatestError().
SimpleErrorQueue::tally | ( | ) |
Any errors still in the queue are sent to the test case. Any unfulfilled expectations trigger failures. public
Definition at line 121 of file errors.php.
References _extractExpectation(), extract(), and getSeverityAsString().
SimpleErrorQueue::_testLatestError | ( | $ | severity, | |
$ | content, | |||
$ | filename, | |||
$ | line | |||
) |
Tests the error against the most recent expected error.
integer | $severity PHP error code. | |
string | $content Text of error. | |
string | $filename File error occoured in. | |
integer | $line Line number of error. private |
Definition at line 140 of file errors.php.
References $content, _extractExpectation(), and getSeverityAsString().
Referenced by add().
SimpleErrorQueue::extract | ( | ) |
Pulls the earliest error from the queue.
Definition at line 163 of file errors.php.
Referenced by tally().
SimpleErrorQueue::_extractExpectation | ( | ) |
Pulls the earliest expectation from the queue.
Definition at line 175 of file errors.php.
Referenced by _testLatestError(), and tally().
SimpleErrorQueue::getSeverityAsString | ( | $ | severity | ) | [static] |
Converts an error code into it's string representation.
$severity | PHP integer error code. |
Definition at line 190 of file errors.php.
Referenced by _testLatestError(), SimpleTestErrorHandler(), and tally().
SimpleErrorQueue::$_queue |
Definition at line 54 of file errors.php.
SimpleErrorQueue::$_expectation_queue |
Definition at line 55 of file errors.php.
SimpleErrorQueue::$_test |
Definition at line 56 of file errors.php.
SimpleErrorQueue::$_using_expect_style = false |
Definition at line 57 of file errors.php.