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
23 require_once 'PHPUnit/TestCase.php';
24 require_once 'PHPUnit/TestResult.php';
25 require_once 'PHPUnit/TestSuite.php';
28 * PHPUnit runs a TestSuite and returns a TestResult object.
34 * require_once 'PHPUnit.php';
36 * class MathTest extends PHPUnit_TestCase {
40 * function MathTest($name) {
41 * $this->PHPUnit_TestCase($name);
49 * function testAdd() {
50 * $this->assertTrue($this->fValue1 + $this->fValue2 == 5);
54 * $suite = new PHPUnit_TestSuite();
55 * $suite->addTest(new MathTest('testAdd'));
57 * $result = PHPUnit::run($suite);
58 * print $result->toHTML();
62 * Alternatively, you can pass a class name to the PHPUnit_TestSuite()
63 * constructor and let it automatically add all methods of that class
64 * that start with 'test' to the suite:
68 * $suite = new PHPUnit_TestSuite('MathTest');
69 * $result = PHPUnit::run($suite);
70 * print $result->toHTML();
76 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
77 * @copyright 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
78 * @license http://www.php.net/license/3_0.txt PHP License 3.0
79 * @version Release: @package_version@
80 * @link http://pear.php.net/package/PHPUnit
81 * @since Class available since Release 1.0.0
88 * @return PHPUnit_TestResult
91 function &run(&$suite, $show_progress=false) {
92 $result = new PHPUnit_TestResult();
93 $suite->run($result, $show_progress);
103 * c-hanging-comment-ender-p: nil