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

From: Date: Sat, 04 Mar 2006 21:00:55 +0000
Subject: cvs: pear /PHPUnit2/Tests/Framework AssertTest.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38912@lists.php.net to get a copy of this message
sebastian Sat Mar 4 21:00:55 2006 UTC Modified files: /pear/PHPUnit2/Tests/Framework AssertTest.php Log: Add tests for assertFileExists() and assertFileNotExists(). http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Tests/Framework/AssertTest.php?r1=1.28&r2=1.29&diff_format=u Index: pear/PHPUnit2/Tests/Framework/AssertTest.php diff -u pear/PHPUnit2/Tests/Framework/AssertTest.php:1.28 pear/PHPUnit2/Tests/Framework/AssertTest.php:1.29 --- pear/PHPUnit2/Tests/Framework/AssertTest.php:1.28 Sat Mar 4 18:53:42 2006 +++ pear/PHPUnit2/Tests/Framework/AssertTest.php Sat Mar 4 21:00:54 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.28 2006/03/04 18:53:42 sebastian Exp $ + * @version CVS: $Id: AssertTest.php,v 1.29 2006/03/04 21:00:54 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -447,6 +447,36 @@ $this->fail(); } + public function testAssertFileExists() + { + $this->assertFileExists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'AllTests.php'); + + try { + $this->assertFileExists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'NotExisting'); + } + + catch (PHPUnit2_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + public function testAssertFileNotExists() + { + $this->assertFileNotExists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'NotExisting'); + + try { + $this->assertFileNotExists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'AllTests.php'); + } + + catch (PHPUnit2_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + public function testAssertHasProperty() { $o = new WasRun('runTest');

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