cvs: pear /PHPUnit2 package.xml /PHPUnit2/Framework TestResult.php /PHPUnit2/TextUI TestRunner.php
| From: | Sebastian Bergmann | Date: | Mon, 23 May 2005 08:44:19 +0000 |
| Subject: | cvs: pear /PHPUnit2 package.xml /PHPUnit2/Framework TestResult.php /PHPUnit2/TextUI TestRunner.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-32048@lists.php.net to get a copy of this message | ||
sebastian Mon May 23 04:44:19 2005 EDT
Modified files:
/pear/PHPUnit2 package.xml
/pear/PHPUnit2/Framework TestResult.php
/pear/PHPUnit2/TextUI TestRunner.php
Log:
Introduce PHPUnit2_Framework_TestResult::collectCodeCoverageInformation() method.
http://cvs.php.net/diff.php/pear/PHPUnit2/package.xml?r1=1.107&r2=1.108&ty=u
Index: pear/PHPUnit2/package.xml
diff -u pear/PHPUnit2/package.xml:1.107 pear/PHPUnit2/package.xml:1.108
--- pear/PHPUnit2/package.xml:1.107 Mon May 23 01:25:25 2005
+++ pear/PHPUnit2/package.xml Mon May 23 04:44:18 2005
@@ -26,7 +26,7 @@
* Code Coverage collection has been moved from PHPUnit2_Framework_TestCase to
PHPUnit2_Framework_TestResult. This allows for Code Coverage analysis of tests that are written in a
class that does not inherit from PHPUnit2_Framework_TestCase.
-* Code Coverage information is no longer collected by default (when the Xdebug extension is
available) but only when it is requested (by using the --coverage-* parameters with the TextUI
TestRunner, for instance). PHPUnit2_Framework_TestResult::$collectCodeCoverageInformation has to be
set to TRUE to collect Code Coverage information.
+* Code Coverage information is no longer collected by default (when the Xdebug extension is
available) but only when it is requested (by using the --coverage-* parameters with the TextUI
TestRunner, for instance). PHPUnit2_Framework_TestResult::collectCodeCoverageInformation(TRUE) has
to be called to enable the collection of Code Coverage information.
* PHPUnit2_Framework_Assert::assertType() and PHPUnit2_Framework_AssertNotType() now consider
subclasses when used on objects.
http://cvs.php.net/diff.php/pear/PHPUnit2/Framework/TestResult.php?r1=1.24&r2=1.25&ty=u
Index: pear/PHPUnit2/Framework/TestResult.php
diff -u pear/PHPUnit2/Framework/TestResult.php:1.24 pear/PHPUnit2/Framework/TestResult.php:1.25
--- pear/PHPUnit2/Framework/TestResult.php:1.24 Mon May 23 00:37:27 2005
+++ pear/PHPUnit2/Framework/TestResult.php Mon May 23 04:44:19 2005
@@ -15,7 +15,7 @@
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: TestResult.php,v 1.24 2005/05/23 04:37:27 sebastian Exp $
+ * @version CVS: $Id: TestResult.php,v 1.25 2005/05/23 08:44:19 sebastian Exp $
* @link http://pear.php.net/package/PHPUnit2
* @since File available since Release 2.0.0
*/
@@ -69,16 +69,15 @@
* Code Coverage information provided by Xdebug.
*
* @var array
- * @access private
+ * @access protected
*/
- private $codeCoverageInformation = array();
+ protected $codeCoverageInformation = array();
/**
* @var boolean
- * @access public
- * @static
+ * @access protected
*/
- public static $collectCodeCoverageInformation = FALSE;
+ protected $collectCodeCoverageInformation = FALSE;
/**
* Current test.
@@ -322,7 +321,7 @@
set_error_handler(array($this, 'errorHandler'));
- $useXdebug = (extension_loaded('xdebug') &&
self::$collectCodeCoverageInformation);
+ $useXdebug = (extension_loaded('xdebug') &&
$this->collectCodeCoverageInformation);
if ($useXdebug) {
xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
@@ -402,6 +401,22 @@
}
/**
+ * Enables or disables the collection of Code Coverage information.
+ *
+ * @param boolean $flag
+ * @throws InvalidArgumentException
+ * @access public
+ * @since Method available since Release 2.3.0
+ */
+ public function collectCodeCoverageInformation($flag) {
+ if (is_bool($flag)) {
+ $this->collectCodeCoverageInformation = $flag;
+ } else {
+ throw new InvalidArgumentException;
+ }
+ }
+
+ /**
* @param integer $errno
* @param string $errstr
* @param string $errfile
http://cvs.php.net/diff.php/pear/PHPUnit2/TextUI/TestRunner.php?r1=1.58&r2=1.59&ty=u
Index: pear/PHPUnit2/TextUI/TestRunner.php
diff -u pear/PHPUnit2/TextUI/TestRunner.php:1.58 pear/PHPUnit2/TextUI/TestRunner.php:1.59
--- pear/PHPUnit2/TextUI/TestRunner.php:1.58 Mon May 23 01:25:27 2005
+++ pear/PHPUnit2/TextUI/TestRunner.php Mon May 23 04:44:19 2005
@@ -15,7 +15,7 @@
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: TestRunner.php,v 1.58 2005/05/23 05:25:27 sebastian Exp $
+ * @version CVS: $Id: TestRunner.php,v 1.59 2005/05/23 08:44:19 sebastian Exp $
* @link http://pear.php.net/package/PHPUnit2
* @since File available since Release 2.0.0
*/
@@ -381,7 +381,7 @@
if ($coverageDataFile !== FALSE ||
$coverageHTMLFile !== FALSE ||
$coverageTextFile !== FALSE) {
- PHPUnit2_Framework_TestResult::$collectCodeCoverageInformation = TRUE;
+ $result->collectCodeCoverageInformation(TRUE);
}
$timer->start();