cvs: pear /PHPUnit2 package.xml /PHPUnit2/Framework Assert.php
| From: | Sebastian Bergmann | Date: | Sun, 05 Sep 2004 07:33:16 +0000 |
| Subject: | cvs: pear /PHPUnit2 package.xml /PHPUnit2/Framework Assert.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-23646@lists.php.net to get a copy of this message | ||
sebastian Sun Sep 5 03:33:16 2004 EDT
Modified files:
/pear/PHPUnit2/Framework Assert.php
/pear/PHPUnit2 package.xml
Log:
Change the parameter order for the PHPUnit2_Framework_Assert::assertEquals() method. $delta is now
the last (optional) parameter in order to allow for assertEquals($expected, $actual, $message) calls
with non-numeric values.
http://cvs.php.net/diff.php/pear/PHPUnit2/Framework/Assert.php?r1=1.6&r2=1.7&ty=u
Index: pear/PHPUnit2/Framework/Assert.php
diff -u pear/PHPUnit2/Framework/Assert.php:1.6 pear/PHPUnit2/Framework/Assert.php:1.7
--- pear/PHPUnit2/Framework/Assert.php:1.6 Sat Sep 4 03:17:22 2004
+++ pear/PHPUnit2/Framework/Assert.php Sun Sep 5 03:33:13 2004
@@ -12,7 +12,7 @@
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
//
-// $Id: Assert.php,v 1.6 2004/09/04 07:17:22 sebastian Exp $
+// $Id: Assert.php,v 1.7 2004/09/05 07:33:13 sebastian Exp $
//
require_once 'PHPUnit2/Framework/AssertionFailedError.php';
@@ -50,19 +50,19 @@
protected function __construct() {}
// }}}
- // {{{ public static function assertEquals($expected, $actual, $delta = 0, $message =
'')
+ // {{{ public static function assertEquals($expected, $actual, $message = '', $delta
= 0)
/**
* Asserts that two variables are equal.
*
* @param mixed $expected
* @param mixed $actual
- * @param mixed $delta
* @param string $message
+ * @param mixed $delta
* @access public
* @static
*/
- public static function assertEquals($expected, $actual, $delta = 0, $message = '') {
+ public static function assertEquals($expected, $actual, $message = '', $delta = 0) {
if (is_null($expected) && is_null($actual)) {
return;
}
@@ -88,7 +88,7 @@
$expected = self::convertToString($expected);
}
- self::assertEquals(serialize($expected), serialize($actual), 0, $message);
+ self::assertEquals(serialize($expected), serialize($actual), $message);
return;
}
http://cvs.php.net/diff.php/pear/PHPUnit2/package.xml?r1=1.29&r2=1.30&ty=u
Index: pear/PHPUnit2/package.xml
diff -u pear/PHPUnit2/package.xml:1.29 pear/PHPUnit2/package.xml:1.30
--- pear/PHPUnit2/package.xml:1.29 Sat Sep 4 03:20:36 2004
+++ pear/PHPUnit2/package.xml Sun Sep 5 03:33:15 2004
@@ -48,6 +48,14 @@
* Code Coverage information for source files that contain the executed
test cases is no longer collected. Code Coverage information only
makes sense for production code ie. code that is tested.
+
+* Changed the parameter order for the PHPUnit2_Framework_Assert::assertEquals()
+ method. $delta is now the last (optional) parameter in order to
+ allow for assertEquals($expected, $actual, $message) calls with
+ non-numeric values.
+
+! The PHPUnit2_Framework_Assert::assertEquals() API change breaks
+ backwards-compatibility.
]]>
</notes>
<filelist>