cvs: pear /PHPUnit PHPUnit_Assert.php PHPUnit_TestResult.php

From: Date: Fri, 12 Jul 2002 05:26:00 +0000
Subject: cvs: pear /PHPUnit PHPUnit_Assert.php PHPUnit_TestResult.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5064@lists.php.net to get a copy of this message
sebastian Fri Jul 12 01:26:00 2002 EDT Modified files: /pear/PHPUnit PHPUnit_Assert.php PHPUnit_TestResult.php Log: Actually, there's no need to check for the ZendEngine2 here. Also, fix PHPDoc. Index: pear/PHPUnit/PHPUnit_Assert.php diff -u pear/PHPUnit/PHPUnit_Assert.php:1.11 pear/PHPUnit/PHPUnit_Assert.php:1.12 --- pear/PHPUnit/PHPUnit_Assert.php:1.11 Thu Jul 11 11:24:04 2002 +++ pear/PHPUnit/PHPUnit_Assert.php Fri Jul 12 01:26:00 2002 @@ -17,11 +17,9 @@ // | M@rms <marms@marms.com> | // +----------------------------------------------------------------------+ // -// $Id: PHPUnit_Assert.php,v 1.11 2002/07/11 15:24:04 sebastian Exp $ +// $Id: PHPUnit_Assert.php,v 1.12 2002/07/12 05:26:00 sebastian Exp $ // -require_once 'PEAR.php'; - /** * A set of assert methods. * @@ -38,7 +36,6 @@ * @param string * @param mixed * @access public - * @static */ function assertEquals($expected, $actual, $message = '', $delta = 0) { if (empty($message)) { @@ -80,7 +77,6 @@ * @param object * @param string * @access public - * @static */ function assertNotNull($object, $message = '') { if (empty($message)) { @@ -100,7 +96,6 @@ * @param object * @param string * @access public - * @static */ function assertNull($object, $message = '') { if (empty($message)) { @@ -116,30 +111,23 @@ /** * Asserts that two objects refer to the same object. - * This requires the Zend Engine 2. + * This requires the Zend Engine 2 (to work properly). * * @param object * @param object * @param string * @access public - * @static */ function assertSame($expected, $actual, $message = '') { if (empty($message)) { $message = 'expected two objects to refer to the same object'; } - if (PEAR_ZE2) { - if ($expected !== $actual) { - return $this->fail($message); - } else { - return $this->pass(); - } - } else { - return PEAR::raiseError( - 'PHPUnit_Assert::assertSame() requires the Zend Engine 2.' - ); + if ($expected !== $actual) { + return $this->fail($message); } + + return $this->pass(); } /** @@ -148,7 +136,6 @@ * @param boolean * @param string * @access public - * @static */ function assertTrue($condition, $message = '') { if (empty($message)) { @@ -171,7 +158,6 @@ * @param string * @access public * @author M@rms <marms@marms.com> - * @static */ function assertRegExp($expected, $actual, $message = '') { if (empty($message)) { @@ -194,16 +180,16 @@ * * @param string * @access protected + * @abstract */ - function fail($message = '') { - } + function fail($message = '') { /* abstract */ } /** * Passes a test. * * @access protected + * @abstract */ - function pass() { - } + function pass() { /* abstract */ } } ?> Index: pear/PHPUnit/PHPUnit_TestResult.php diff -u pear/PHPUnit/PHPUnit_TestResult.php:1.7 pear/PHPUnit/PHPUnit_TestResult.php:1.8 --- pear/PHPUnit/PHPUnit_TestResult.php:1.7 Thu Jul 11 13:19:11 2002 +++ pear/PHPUnit/PHPUnit_TestResult.php Fri Jul 12 01:26:00 2002 @@ -16,7 +16,7 @@ // | Author: Sebastian Bergmann <sb@sebastian-bergmann.de> | // +----------------------------------------------------------------------+ // -// $Id: PHPUnit_TestResult.php,v 1.7 2002/07/11 17:19:11 sebastian Exp $ +// $Id: PHPUnit_TestResult.php,v 1.8 2002/07/12 05:26:00 sebastian Exp $ // require_once 'PHPUnit/PHPUnit_TestFailure.php'; @@ -172,16 +172,15 @@ /** * Unregisters a TestListener. + * This requires the Zend Engine 2 (to work properly). * * @param object * @access public */ function removeListener(&$listener) { - if (PEAR_ZE2) { - for ($i = 0; $i < sizeof($this->_listeners); $i++) { - if ($this->_listeners[$i] === $listener) { - unset($this->_listeners[$i]); - } + for ($i = 0; $i < sizeof($this->_listeners); $i++) { + if ($this->_listeners[$i] === $listener) { + unset($this->_listeners[$i]); } } }

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