Class ExceptionExpectation

Description

Tests exceptions either by type or the exact exception. This could be improved to accept a pattern expectation to test the error message, but that will have to come later.

Located in /exceptions.php (line 70)

SimpleExpectation
   |
   --ExceptionExpectation
Method Summary
 ExceptionExpectation __construct (mixed $expected, [string $message = '%s'])
 string describeException ( $exception, Exception $compare)
 boolean test (Exception $compare)
 string testMessage (Exception $compare)
Variables
Methods
Constructor __construct (line 85)

Sets up the conditions to test against.

If the expected value is a string, then it will act as a test of the class name. An exception as the comparison will trigger an identical match. Writing this down now makes it look doubly dumb. I hope come up with a better scheme later.

ExceptionExpectation __construct (mixed $expected, [string $message = '%s'])
  • mixed $expected: A class name or an actual exception to compare with.
  • string $message: Message to display.
describeException (line 125)

Summary of an Exception object.

  • return: Text description.
  • access: protected
string describeException ( $exception, Exception $compare)
  • Exception $compare: Exception to describe.
  • $exception
test (line 95)

Carry out the test.

  • return: True if matched.
boolean test (Exception $compare)
  • Exception $compare: Value to check.

Redefinition of:
SimpleExpectation::test()
Tests the expectation. True if correct.
testMessage (line 110)

Create the message to display describing the test.

  • return: Final message.
string testMessage (Exception $compare)
  • Exception $compare: Exception to match.

Redefinition of:
SimpleExpectation::testMessage()
Returns a human readable test message.

Inherited Methods

Inherited From SimpleExpectation

 SimpleExpectation::SimpleExpectation()
 SimpleExpectation::isExpectation()
 SimpleExpectation::overlayMessage()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()
 SimpleExpectation::_getDumper()

Documentation generated on Sun, 04 May 2008 09:21:33 -0500 by phpDocumentor 1.3.0