Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
    /**
3
     *	base include file for SimpleTest
4
     *	@package	SimpleTest
5
     *	@subpackage	UnitTester
6
     *	@version	$Id: exceptions.php 1398 2006-09-08 19:31:03Z xue $
7
     */
8
 
9
    /**#@+
10
     * Includes SimpleTest files and defined the root constant
11
     * for dependent libraries.
12
     */
13
    require_once(dirname(__FILE__) . '/invoker.php');
14
 
15
    /**
16
     *    Extension that traps exceptions and turns them into
17
     *    an error message.
18
	 *	  @package SimpleTest
19
	 *	  @subpackage UnitTester
20
     */
21
    class SimpleExceptionTrappingInvoker extends SimpleInvokerDecorator {
22
 
23
        /**
24
         *    Stores the invoker to be wrapped.
25
         *    @param SimpleInvoker $invoker   Test method runner.
26
         */
27
        function SimpleExceptionTrappingInvoker($invoker) {
28
            $this->SimpleInvokerDecorator($invoker);
29
        }
30
 
31
        /**
32
         *    Invokes a test method and dispatches any
33
         *    untrapped errors.
34
         *    @param string $method    Test method to call.
35
         *    @access public
36
         */
37
        function invoke($method) {
38
            try {
39
                parent::invoke($method);
40
            } catch (Exception $exception) {
41
                $test_case = $this->getTestCase();
42
                $test_case->exception($exception);
43
            }
44
        }
45
    }
46
?>