- added INSTALL file
[plcapi.git] / test / PHPUnit / TestListener.php
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
4 /**
5  * PHP Version 4
6  *
7  * LICENSE: This source file is subject to version 3.0 of the PHP license
8  * that is available through the world-wide-web at the following URI:
9  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
10  * the PHP License and are unable to obtain it through the web, please
11  * send a note to license@php.net so we can mail you a copy immediately.
12  *
13  * @category   Testing
14  * @package    PHPUnit
15  * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
16  * @copyright  2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
17  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
18  * @version    CVS: $Id$
19  * @link       http://pear.php.net/package/PHPUnit
20  * @since      File available since Release 1.0.0
21  */
22
23 /**
24  * A Listener for test progress.
25  *
26  * Here is an example:
27  *
28  * <code>
29  * <?php
30  * require_once 'PHPUnit.php';
31  * require_once 'PHPUnit/TestListener.php';
32  *
33  * class MathTest extends PHPUnit_TestCase {
34  *     var $fValue1;
35  *     var $fValue2;
36  *
37  *     function MathTest($name) {
38  *         $this->PHPUnit_TestCase($name);
39  *     }
40  *
41  *     function setUp() {
42  *         $this->fValue1 = 2;
43  *         $this->fValue2 = 3;
44  *     }
45  *
46  *     function testAdd() {
47  *         $this->assertTrue($this->fValue1 + $this->fValue2 == 4);
48  *     }
49  * }
50  *
51  * class MyListener extends PHPUnit_TestListener {
52  *     function addError(&$test, &$t) {
53  *         print "MyListener::addError() called.\n";
54  *     }
55  *
56  *     function addFailure(&$test, &$t) {
57  *         print "MyListener::addFailure() called.\n";
58  *     }
59  *
60  *     function endTest(&$test) {
61  *         print "MyListener::endTest() called.\n";
62  *     }
63  *
64  *     function startTest(&$test) {
65  *         print "MyListener::startTest() called.\n";
66  *     }
67  * }
68  *
69  * $suite = new PHPUnit_TestSuite;
70  * $suite->addTest(new MathTest('testAdd'));
71  *
72  * $result = new PHPUnit_TestResult;
73  * $result->addListener(new MyListener);
74  *
75  * $suite->run($result);
76  * print $result->toString();
77  * ?>
78  * </code>
79  *
80  * @category   Testing
81  * @package    PHPUnit
82  * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
83  * @copyright  2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
84  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
85  * @version    Release: @package_version@
86  * @link       http://pear.php.net/package/PHPUnit
87  * @since      Class available since Release 1.0.0
88  */
89 class PHPUnit_TestListener {
90     /**
91      * An error occurred.
92      *
93      * @param  object
94      * @param  object
95      * @access public
96      * @abstract
97      */
98     function addError(&$test, &$t) { /*abstract */ }
99
100     /**
101      * A failure occurred.
102      *
103      * @param  object
104      * @param  object
105      * @access public
106      * @abstract
107      */
108     function addFailure(&$test, &$t) { /*abstract */ }
109
110     /**
111      * A test ended.
112      *
113      * @param  object
114      * @access public
115      * @abstract
116      */
117     function endTest(&$test) { /*abstract */ }
118
119     /**
120      * A test started.
121      *
122      * @param  object
123      * @access public
124      * @abstract
125      */
126     function startTest(&$test) { /*abstract */ }
127 }
128
129 /*
130  * Local variables:
131  * tab-width: 4
132  * c-basic-offset: 4
133  * c-hanging-comment-ender-p: nil
134  * End:
135  */
136 ?>