cvs: pear(PHPUNIT_2_2) /PHPUnit2 package.xml /PHPUnit2/Framework Assert.php

From: Date: Thu, 23 Dec 2004 07:09:13 +0000
Subject: cvs: pear(PHPUNIT_2_2) /PHPUnit2 package.xml /PHPUnit2/Framework Assert.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-27775@lists.php.net to get a copy of this message
sebastian Thu Dec 23 02:09:13 2004 EDT Modified files: (Branch: PHPUNIT_2_2) /pear/PHPUnit2 package.xml /pear/PHPUnit2/Framework Assert.php Log: MFH: Make assertTrue() and assertFalse() strict, too. http://cvs.php.net/diff.php/pear/PHPUnit2/package.xml?r1=1.77.2.5&r2=1.77.2.6&ty=u Index: pear/PHPUnit2/package.xml diff -u pear/PHPUnit2/package.xml:1.77.2.5 pear/PHPUnit2/package.xml:1.77.2.6 --- pear/PHPUnit2/package.xml:1.77.2.5 Wed Dec 22 10:08:02 2004 +++ pear/PHPUnit2/package.xml Thu Dec 23 02:09:12 2004 @@ -37,6 +37,8 @@ * PHPUnit2_Extensions_CodeCoverage_Renderer_HTML and PHPUnit2_Extensions_CodeCoverage_Renderer_Text now render summarized representations of the Code Coverage information. * PHPUnit2_Framework_Assert::assertSame(), PHPUnit2_Framework_Assert::assertNotSame(), PHPUnit2_Framework_Assert::assertNotNull(), and PHPUnit2_Framework_Assert::assertNull() are now stricter and only work on objects. This was always the documented behaviour. + +* PHPUnit2_Framework_Assert::assertTrue() and PHPUnit2_Framework_Assert::assertFalse() are now stricter and only work on booleans. This was always the documented behaviour. ]]> </notes> <filelist> http://cvs.php.net/diff.php/pear/PHPUnit2/Framework/Assert.php?r1=1.22.2.3&r2=1.22.2.4&ty=u Index: pear/PHPUnit2/Framework/Assert.php diff -u pear/PHPUnit2/Framework/Assert.php:1.22.2.3 pear/PHPUnit2/Framework/Assert.php:1.22.2.4 --- pear/PHPUnit2/Framework/Assert.php:1.22.2.3 Wed Dec 22 03:06:07 2004 +++ pear/PHPUnit2/Framework/Assert.php Thu Dec 23 02:09:12 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: Assert.php,v 1.22.2.3 2004/12/22 08:06:07 sebastian Exp $ +// $Id: Assert.php,v 1.22.2.4 2004/12/23 07:09:12 sebastian Exp $ // require_once 'PHPUnit2/Framework/AssertionFailedError.php'; @@ -158,8 +158,12 @@ * @static */ public static function assertTrue($condition, $message = '') { - if (!$condition) { - self::fail($message); + if (is_bool($condition)) { + if (!$condition) { + self::fail($message); + } + } else { + throw new Exception('Unsupported parameter passed to assertTrue().'); } } @@ -175,7 +179,12 @@ * @static */ public static function assertFalse($condition, $message = '') { - self::assertTrue(!$condition, $message); + if (is_bool($condition)) { + self::assertTrue(!$condition, $message); + } else { + throw new Exception('Unsupported parameter passed to assertFalse().'); + } + } // }}}

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