* PHPUnit_TestCase($name); * } * * function setUp() { * $this->fValue1 = 2; * $this->fValue2 = 3; * } * * function testAdd() { * $this->assertTrue($this->fValue1 + $this->fValue2 == 4); * } * } * * class MyListener extends PHPUnit_TestListener { * function addError(&$test, &$t) { * print "MyListener::addError() called.\n"; * } * * function addFailure(&$test, &$t) { * print "MyListener::addFailure() called.\n"; * } * * function endTest(&$test) { * print "MyListener::endTest() called.\n"; * } * * function startTest(&$test) { * print "MyListener::startTest() called.\n"; * } * } * * $suite = new PHPUnit_TestSuite; * $suite->addTest(new MathTest('testAdd')); * * $result = new PHPUnit_TestResult; * $result->addListener(new MyListener); * * $suite->run($result); * print $result->toString(); * ?> *