[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/tests_runner/lib/simpletest/ -> exceptions.php (summary)

base include file for SimpleTest

Version: $Id: exceptions.php 5999 2007-06-18 13:13:08Z pachanga $
File Size: 192 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

SimpleExceptionTrappingInvoker:: (2 methods):
  SimpleExceptionTrappingInvoker()
  invoke()

ExceptionExpectation:: (4 methods):
  __construct()
  test()
  testMessage()
  describeException()

SimpleExceptionTrap:: (5 methods):
  __construct()
  expectException()
  isExpected()
  getOutstanding()
  clear()


Class: SimpleExceptionTrappingInvoker  - X-Ref

Extension that traps exceptions and turns them into
an error message. PHP5 only.

SimpleExceptionTrappingInvoker($invoker)   X-Ref
Stores the invoker to be wrapped.

param: SimpleInvoker $invoker   Test method runner.

invoke($method)   X-Ref
Invokes a test method whilst trapping expected
exceptions. Any left over unthrown exceptions
are then reported as failures.

param: string $method    Test method to call.

Class: ExceptionExpectation  - X-Ref

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.

__construct($expected, $message = '%s')   X-Ref
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.

param: mixed $expected   A class name or an actual
param: string $message   Message to display.

test($compare)   X-Ref
Carry out the test.

param: Exception $compare    Value to check.
return: boolean              True if matched.

testMessage($compare)   X-Ref
Create the message to display describing the test.

param: Exception $compare     Exception to match.
return: string                Final message.

describeException($exception)   X-Ref
Summary of an Exception object.

param: Exception $compare     Exception to describe.
return: string                Text description.

Class: SimpleExceptionTrap  - X-Ref

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

__construct()   X-Ref
Clears down the queue ready for action.


expectException($expected = false, $message = '%s')   X-Ref
Sets up an expectation of an exception.
This has the effect of intercepting an
exception that matches.

param: SimpleExpectation $expected    Expected exception to match.
param: string $message                Message to display.

isExpected($test, $exception)   X-Ref
Compares the expected exception with any
in the queue. Issues a pass or fail and
returns the state of the test.

param: SimpleTestCase $test    Test case to send messages to.
param: Exception $exception    Exception to compare.
return: boolean                False on no match.

getOutstanding()   X-Ref
Tests for any left over exception.

return: string/false     The failure message or false if none.

clear()   X-Ref
Discards the contents of the error queue.




Generated: Sat Nov 22 03:48:54 2008 Cross-referenced by PHPXref 0.7