Class SimpleExceptionTrap

Description

Stores expected exceptions for when they get thrown. Saves the irritating try...catch block.

Located in /exceptions.php (line 137)


	
			
Method Summary
 SimpleExceptionTrap __construct ()
 void clear ()
 void expectException ([SimpleExpectation $expected = false], [string $message = '%s'])
 string/false getOutstanding ()
 boolean isExpected (SimpleTestCase $test, Exception $exception)
Methods
Constructor __construct (line 145)

Clears down the queue ready for action.

SimpleExceptionTrap __construct ()
clear (line 220)

Discards the contents of the error queue.

void clear ()
expectException (line 157)

Sets up an expectation of an exception.

This has the effect of intercepting an exception that matches.

  • access: public
void expectException ([SimpleExpectation $expected = false], [string $message = '%s'])
  • SimpleExpectation $expected: Expected exception to match.
  • string $message: Message to display.
getOutstanding (line 213)

Tests for any left over exception.

  • return: The failure message or false if none.
string/false getOutstanding ()
ignoreException (line 168)

Adds an exception to the ignore list. This is the list of exceptions that when thrown do not affect the test.

  • access: public
void ignoreException (SimpleExpectation $ignored)
isExpected (line 180)

Compares the expected exception with any in the queue. Issues a pass or fail and returns the state of the test.

  • return: False on no match.
boolean isExpected (SimpleTestCase $test, Exception $exception)
  • SimpleTestCase $test: Test case to send messages to.
  • Exception $exception: Exception to compare.

Documentation generated on Sun, 31 Oct 2010 16:31:23 -0500 by phpDocumentor 1.4.3