2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
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.
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
19 * @link http://pear.php.net/package/PHPUnit
20 * @since File available since Release 1.0.0
24 * A Listener for test progress.
30 * require_once 'PHPUnit.php';
31 * require_once 'PHPUnit/TestListener.php';
33 * class MathTest extends PHPUnit_TestCase {
37 * function MathTest($name) {
38 * $this->PHPUnit_TestCase($name);
46 * function testAdd() {
47 * $this->assertTrue($this->fValue1 + $this->fValue2 == 4);
51 * class MyListener extends PHPUnit_TestListener {
52 * function addError(&$test, &$t) {
53 * print "MyListener::addError() called.\n";
56 * function addFailure(&$test, &$t) {
57 * print "MyListener::addFailure() called.\n";
60 * function endTest(&$test) {
61 * print "MyListener::endTest() called.\n";
64 * function startTest(&$test) {
65 * print "MyListener::startTest() called.\n";
69 * $suite = new PHPUnit_TestSuite;
70 * $suite->addTest(new MathTest('testAdd'));
72 * $result = new PHPUnit_TestResult;
73 * $result->addListener(new MyListener);
75 * $suite->run($result);
76 * print $result->toString();
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
89 class PHPUnit_TestListener {
98 function addError(&$test, &$t) { /*abstract */ }
101 * A failure occurred.
108 function addFailure(&$test, &$t) { /*abstract */ }
117 function endTest(&$test) { /*abstract */ }
126 function startTest(&$test) { /*abstract */ }
133 * c-hanging-comment-ender-p: nil