mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
4a5d9b03f8
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39001 467b73ca-7a2a-4603-9d3b-597d59a354a9
46 lines
1.3 KiB
PHP
Executable File
46 lines
1.3 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* base include file for SimpleTest
|
|
* @package SimpleTest
|
|
* @subpackage UnitTester
|
|
* @version $Id$
|
|
*/
|
|
|
|
/**#@+
|
|
* Includes SimpleTest files and defined the root constant
|
|
* for dependent libraries.
|
|
*/
|
|
require_once(dirname(__FILE__) . '/invoker.php');
|
|
|
|
/**
|
|
* Extension that traps exceptions and turns them into
|
|
* an error message.
|
|
* @package SimpleTest
|
|
* @subpackage UnitTester
|
|
*/
|
|
class SimpleExceptionTrappingInvoker extends SimpleInvokerDecorator {
|
|
|
|
/**
|
|
* Stores the invoker to be wrapped.
|
|
* @param SimpleInvoker $invoker Test method runner.
|
|
*/
|
|
function SimpleExceptionTrappingInvoker($invoker) {
|
|
$this->SimpleInvokerDecorator($invoker);
|
|
}
|
|
|
|
/**
|
|
* Invokes a test method and dispatches any
|
|
* untrapped errors.
|
|
* @param string $method Test method to call.
|
|
* @access public
|
|
*/
|
|
function invoke($method) {
|
|
try {
|
|
parent::invoke($method);
|
|
} catch (Exception $exception) {
|
|
$test_case = &$this->getTestCase();
|
|
$test_case->exception($exception);
|
|
}
|
|
}
|
|
}
|
|
?>
|