cvs: pear /PHPUnit PHPUnit_TestDecorator.php package.xml

From: Date: Thu, 11 Jul 2002 16:00:28 +0000
Subject: cvs: pear /PHPUnit PHPUnit_TestDecorator.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5045@lists.php.net to get a copy of this message
sebastian Thu Jul 11 12:00:28 2002 EDT Added files: /pear/PHPUnit PHPUnit_TestDecorator.php Modified files: /pear/PHPUnit package.xml Log: Start working on PHPUnit_TestDecorator. Index: pear/PHPUnit/package.xml diff -u pear/PHPUnit/package.xml:1.15 pear/PHPUnit/package.xml:1.16 --- pear/PHPUnit/package.xml:1.15 Thu Jul 11 11:49:36 2002 +++ pear/PHPUnit/package.xml Thu Jul 11 12:00:28 2002 @@ -24,6 +24,8 @@ <date>2002-XX-XX</date> <notes> <![CDATA[ +* Added PHPUnit_TestDecorator. + * Implemented PHPUnit_TestResult::addListener() and PHPUnit_TestResult::removeListener(). @@ -38,6 +40,7 @@ <file role="php" name="PHPUnit.php"/> <file role="php" name="PHPUnit_Assert.php"/> <file role="php" name="PHPUnit_TestCase.php"/> + <file role="php" name="PHPUnit_TestDecorator.php"/> <file role="php" name="PHPUnit_TestFailure.php"/> <file role="php" name="PHPUnit_TestResult.php"/> <file role="php" name="PHPUnit_TestSuite.php"/> Index: pear/PHPUnit/PHPUnit_TestDecorator.php +++ pear/PHPUnit/PHPUnit_TestDecorator.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Sebastian Bergmann <sb@sebastian-bergmann.de> | // +----------------------------------------------------------------------+ // // $Id: PHPUnit_TestDecorator.php,v 1.1 2002/07/11 16:00:28 sebastian Exp $ // require_once 'PHPUnit/PHPUnit_Assert.php'; require_once 'PHPUnit/PHPUnit_TestResult.php'; /** * A Decorator for Tests. * Use TestDecorator as the base class for defining new * test decorators. Test decorator subclasses can be introduced * to add behaviour before or after a test is run. * * @package PHPUnit * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit_TestDecorator extends PHPUnit_Assert { /** * The Test to be decorated. * * @var object * @access protected */ var $_test = null; /** * Runs the test and collects the * result in a TestResult. * * @param object * @access public */ function basicRun(&$result) { $this->_test->run($result); } /** * Counts the number of test cases that * will be run by this test. * * @return integer * @access public */ function countTestCases() { return $this->_test->countTestCases(); } /** * Returns the test to be run. * * @return object * @access public */ function &getTest() { return $this->_test; } /** * Runs the decorated test and collects the * result in a TestResult. * * @param object * @access public */ function run(&$result) { // ... } /** * Returns a string representation of the test. * * @return string * @access public */ function toString() { return $this->_test->toString(); } } ?>

« previous php.pear.cvs (#5045) next »