SimpleErrorQueue Class Reference

List of all members.


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


Detailed Description

Definition at line 53 of file errors.php.


Member Function Documentation

SimpleErrorQueue::SimpleErrorQueue (  ) 

Starts with an empty queue.

Definition at line 62 of file errors.php.

References clear().

Here is the call graph for this function:

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.

Parameters:
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.

Parameters:
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.

Parameters:
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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

SimpleErrorQueue::_testLatestError ( severity,
content,
filename,
line 
)

Tests the error against the most recent expected error.

Parameters:
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().

Here is the call graph for this function:

SimpleErrorQueue::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 163 of file errors.php.

Referenced by tally().

SimpleErrorQueue::_extractExpectation (  ) 

Pulls the earliest expectation from the queue.

Returns:
SimpleExpectation False if none. private

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.

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

Definition at line 190 of file errors.php.

Referenced by _testLatestError(), SimpleTestErrorHandler(), and tally().


Member Data Documentation

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.


The documentation for this class was generated from the following file:

Generated on Mon Jun 2 15:09:11 2008 for SimpleTest by  1.5.5