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

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$dumper
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.

Redefinition of:
SimpleExpectation::__construct()
Creates a dumper for displaying values and sets the test message.
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::__construct()
 SimpleExpectation::getDumper()
 SimpleExpectation::isExpectation()
 SimpleExpectation::overlayMessage()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()

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