cvs: pear /PHPUnit PHPUnit_RepeatedTest.php package.xml
| From: | Sebastian Bergmann | Date: | Thu, 11 Jul 2002 17:48:54 +0000 |
| Subject: | cvs: pear /PHPUnit PHPUnit_RepeatedTest.php package.xml | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5051@lists.php.net to get a copy of this message | ||
sebastian Thu Jul 11 13:48:54 2002 EDT
Added files:
/pear/PHPUnit PHPUnit_RepeatedTest.php
Modified files:
/pear/PHPUnit package.xml
Log:
Add PHPUnit_RepeatedTest.
Index: pear/PHPUnit/package.xml
diff -u pear/PHPUnit/package.xml:1.17 pear/PHPUnit/package.xml:1.18
--- pear/PHPUnit/package.xml:1.17 Thu Jul 11 13:19:11 2002
+++ pear/PHPUnit/package.xml Thu Jul 11 13:48:52 2002
@@ -24,7 +24,7 @@
<date>2002-XX-XX</date>
<notes>
<![CDATA[
-* Added PHPUnit_TestDecorator.
+* Added PHPUnit_TestDecorator and PHPUnit_RepeatedTest.
* Implemented PHPUnit_TestResult::addListener() and
PHPUnit_TestResult::removeListener().
@@ -39,6 +39,7 @@
<dir name="/" baseinstalldir="PHPUnit">
<file role="php" name="PHPUnit.php"/>
<file role="php" name="PHPUnit_Assert.php"/>
+ <file role="php" name="PHPUnit_RepeatedTest.php"/>
<file role="php" name="PHPUnit_TestCase.php"/>
<file role="php" name="PHPUnit_TestDecorator.php"/>
<file role="php" name="PHPUnit_TestFailure.php"/>
Index: pear/PHPUnit/PHPUnit_RepeatedTest.php
+++ pear/PHPUnit/PHPUnit_RepeatedTest.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_RepeatedTest.php,v 1.1 2002/07/11 17:48:52 sebastian Exp $
//
require_once 'PHPUnit/PHPUnit_TestDecorator.php';
/**
* A Decorator that runs a test repeatedly.
*
* @package PHPUnit
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* Based upon JUnit, see http://www.junit.org/ for
details.
*/
class PHPUnit_RepeatedTest extends PHPUnit_TestDecorator {
/**
* @var integer
* @access private
*/
var $_timesRepeat = 1;
/**
* Constructor.
*
* @param object
* @param integer
* @access public
*/
function PHPUnit_RepeatedTest(&$test, $timesRepeat = 1) {
$this->PHPUnit_TestDecorator($test);
$this->_timesRepeat = $timesRepeat;
}
/**
* Counts the number of test cases that
* will be run by this test.
*
* @return integer
* @access public
*/
function countTestCases() {
return $this->_timesRepeat * $this->_test->countTestCases();
}
}
/**
* Runs the decorated test and collects the
* result in a TestResult.
*
* @param object
* @access public
* @abstract
*/
function run(&$result) {
for ($i = 0; $i < $this->_timesRepeat; $i++) {
$this->_test->run($result);
}
}
}
?>