cvs: pear /PHPUnit PHPUnit_RepeatedTest.php PHPUnit_TestDecorator.php

From: Date: Fri, 12 Jul 2002 05:13:18 +0000
Subject: cvs: pear /PHPUnit PHPUnit_RepeatedTest.php PHPUnit_TestDecorator.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5063@lists.php.net to get a copy of this message
sebastian Fri Jul 12 01:13:18 2002 EDT Modified files: /pear/PHPUnit PHPUnit_RepeatedTest.php PHPUnit_TestDecorator.php Log: Move the example to where it belongs. Index: pear/PHPUnit/PHPUnit_RepeatedTest.php diff -u pear/PHPUnit/PHPUnit_RepeatedTest.php:1.2 pear/PHPUnit/PHPUnit_RepeatedTest.php:1.3 --- pear/PHPUnit/PHPUnit_RepeatedTest.php:1.2 Fri Jul 12 01:03:07 2002 +++ pear/PHPUnit/PHPUnit_RepeatedTest.php Fri Jul 12 01:13:17 2002 @@ -16,13 +16,49 @@ // | Author: Sebastian Bergmann <sb@sebastian-bergmann.de> | // +----------------------------------------------------------------------+ // -// $Id: PHPUnit_RepeatedTest.php,v 1.2 2002/07/12 05:03:07 sebastian Exp $ +// $Id: PHPUnit_RepeatedTest.php,v 1.3 2002/07/12 05:13:17 sebastian Exp $ // require_once 'PHPUnit/PHPUnit_TestDecorator.php'; /** * A Decorator that runs a test repeatedly. + * + * Here is an example: + * + * <?php + * require_once 'PHPUnit/PHPUnit.php'; + * require_once 'PHPUnit/PHPUnit_RepeatedTest.php'; + * + * class MathTest extends PHPUnit_TestCase { + * var $fValue1; + * var $fValue2; + * + * function MathTest($name) { + * $this->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 PHPUnit_RepeatedTest( + * new MathTest('testAdd'), + * 10 + * ) + * ); + * + * $result = PHPUnit::run($suite); + * echo $result->toString(); + * ?> * * @package PHPUnit * @author Sebastian Bergmann <sb@sebastian-bergmann.de> Index: pear/PHPUnit/PHPUnit_TestDecorator.php diff -u pear/PHPUnit/PHPUnit_TestDecorator.php:1.4 pear/PHPUnit/PHPUnit_TestDecorator.php:1.5 --- pear/PHPUnit/PHPUnit_TestDecorator.php:1.4 Fri Jul 12 01:12:30 2002 +++ pear/PHPUnit/PHPUnit_TestDecorator.php Fri Jul 12 01:13:17 2002 @@ -16,7 +16,7 @@ // | Author: Sebastian Bergmann <sb@sebastian-bergmann.de> | // +----------------------------------------------------------------------+ // -// $Id: PHPUnit_TestDecorator.php,v 1.4 2002/07/12 05:12:30 sebastian Exp $ +// $Id: PHPUnit_TestDecorator.php,v 1.5 2002/07/12 05:13:17 sebastian Exp $ // /** @@ -25,42 +25,6 @@ * 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. - * - * Here is an example: - * - * <?php - * require_once 'PHPUnit/PHPUnit.php'; - * require_once 'PHPUnit/PHPUnit_RepeatedTest.php'; - * - * class MathTest extends PHPUnit_TestCase { - * var $fValue1; - * var $fValue2; - * - * function MathTest($name) { - * $this->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 PHPUnit_RepeatedTest( - * new MathTest('testAdd'), - * 10 - * ) - * ); - * - * $result = PHPUnit::run($suite); - * echo $result->toString(); - * ?> * * @package PHPUnit * @author Sebastian Bergmann <sb@sebastian-bergmann.de>

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