Moodle  2.2.1
http://www.collinsharper.com
SimpleErrorQueue Class Reference

Public Member Functions

 SimpleErrorQueue ()
 clear ()
 setTestCase (&$test)
 expectError ($expected, $message)
 add ($severity, $content, $filename, $line)
 tally ()
 _testLatestError ($severity, $content, $filename, $line)
 extract ()
 _extractExpectation ()
 assertNoErrors ($message)
 assertError ($expected, $message)

Static Public Member Functions

 getSeverityAsString ($severity)

Data Fields

 $_queue
 $_expectation_queue
 $_test
 $_using_expect_style = false

Detailed Description

Definition at line 85 of file errors.php.


Member Function Documentation

Pulls the earliest expectation from the queue.

Returns:
SimpleExpectation False if none. private

Definition at line 207 of file errors.php.

Here is the caller graph for this function:

_testLatestError ( severity,
content,
filename,
line 
)

Tests the error against the most recent expected error.

Parameters:
integer$severityPHP error code.
string$contentText of error.
string$filenameFile error occoured in.
integer$lineLine number of error. private

Definition at line 173 of file errors.php.

Here is the call graph for this function:

Here is the caller graph for this function:

add ( severity,
content,
filename,
line 
)

Adds an error to the front of the queue.

Parameters:
integer$severityPHP error code.
string$contentText of error.
string$filenameFile error occoured in.
integer$lineLine number of error. public

Definition at line 138 of file errors.php.

Here is the call graph for this function:

assertError ( expected,
message 
)
Deprecated:

Definition at line 227 of file errors.php.

Here is the call graph for this function:

assertNoErrors ( message)
Deprecated:

Definition at line 217 of file errors.php.

clear ( )

Discards the contents of the error queue. public

Definition at line 102 of file errors.php.

Here is the caller graph for this function:

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.

Parameters:
SimpleExpectation$expectedExpected error match.
string$messageMessage to display. public

Definition at line 125 of file errors.php.

extract ( )

Pulls the earliest error from the queue.

Returns:
mixed False if none, or a list of error information. Elements are: severity as the PHP error code, the error message, the file with the error, the line number and a list of PHP super global arrays. public

Definition at line 195 of file errors.php.

Here is the caller graph for this function:

getSeverityAsString ( severity) [static]

Converts an error code into it's string representation.

Parameters:
$severityPHP integer error code.
Returns:
String version of error code. public

Definition at line 248 of file errors.php.

Here is the caller graph for this function:

setTestCase ( &$  test)

Sets the currently running test case.

Parameters:
SimpleTestCase$testTest case to send messages to. public

Definition at line 112 of file errors.php.

Starts with an empty queue.

Definition at line 94 of file errors.php.

Here is the call graph for this function:

tally ( )

Any errors still in the queue are sent to the test case. Any unfulfilled expectations trigger failures. public

Definition at line 154 of file errors.php.

Here is the call graph for this function:


Field Documentation

$_expectation_queue

Definition at line 87 of file errors.php.

$_queue

Definition at line 86 of file errors.php.

$_test

Definition at line 88 of file errors.php.

$_using_expect_style = false

Definition at line 89 of file errors.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations