* @copyright 2002-2005 Sebastian Bergmann * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version CVS: $Id$ * @link http://pear.php.net/package/PHPUnit * @since File available since Release 1.0.0 */ require_once 'PHPUnit/TestCase.php'; require_once 'PHPUnit/TestResult.php'; require_once 'PHPUnit/TestSuite.php'; /** * PHPUnit runs a TestSuite and returns a TestResult object. * * Here is an example: * * * PHPUnit_TestCase($name); * } * * function setUp() { * $this->fValue1 = 2; * $this->fValue2 = 3; * } * * function testAdd() { * $this->assertTrue($this->fValue1 + $this->fValue2 == 5); * } * } * * $suite = new PHPUnit_TestSuite(); * $suite->addTest(new MathTest('testAdd')); * * $result = PHPUnit::run($suite); * print $result->toHTML(); * ?> * * * Alternatively, you can pass a class name to the PHPUnit_TestSuite() * constructor and let it automatically add all methods of that class * that start with 'test' to the suite: * * * toHTML(); * ?> * * * @category Testing * @package PHPUnit * @author Sebastian Bergmann * @copyright 2002-2005 Sebastian Bergmann * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: @package_version@ * @link http://pear.php.net/package/PHPUnit * @since Class available since Release 1.0.0 */ class PHPUnit { /** * Runs a test(suite). * * @param mixed * @return PHPUnit_TestResult * @access public */ function &run(&$suite, $show_progress=false) { $result = new PHPUnit_TestResult(); $suite->run($result, $show_progress); return $result; } } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * End: */ ?>