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 144)

Clears down the queue ready for action.

SimpleExceptionTrap __construct ()
clear (line 193)

Discards the contents of the error queue.

void clear ()
expectException (line 156)

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 186)

Tests for any left over exception.

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

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, 04 May 2008 09:21:33 -0500 by phpDocumentor 1.3.0