cvs: pear /PHPUnit2/Tests/Framework AssertTest.php

From: Date: Sun, 05 Mar 2006 17:49:30 +0000
Subject: cvs: pear /PHPUnit2/Tests/Framework AssertTest.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38922@lists.php.net to get a copy of this message
sebastian Sun Mar 5 17:49:30 2006 UTC Modified files: /pear/PHPUnit2/Tests/Framework AssertTest.php Log: Add tests for assertRegExp() and assertNotRegExp(). http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Tests/Framework/AssertTest.php?r1=1.30&r2=1.31&diff_format=u Index: pear/PHPUnit2/Tests/Framework/AssertTest.php diff -u pear/PHPUnit2/Tests/Framework/AssertTest.php:1.30 pear/PHPUnit2/Tests/Framework/AssertTest.php:1.31 --- pear/PHPUnit2/Tests/Framework/AssertTest.php:1.30 Sun Mar 5 07:37:16 2006 +++ pear/PHPUnit2/Tests/Framework/AssertTest.php Sun Mar 5 17:49:30 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: AssertTest.php,v 1.30 2006/03/05 07:37:16 sebastian Exp $ + * @version CVS: $Id: AssertTest.php,v 1.31 2006/03/05 17:49:30 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -571,6 +571,36 @@ $this->fail(); } + public function testAssertRegExp() + { + $this->assertRegExp('/foo/', 'foobar'); + + try { + $this->assertRegExp('/foo/', 'bar'); + } + + catch (PHPUnit2_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + public function testAssertNotRegExp() + { + $this->assertNotRegExp('/foo/', 'bar'); + + try { + $this->assertNotRegExp('/foo/', 'foobar'); + } + + catch (PHPUnit2_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + public function testAssertSame() { $o = new stdClass;

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