cvs: pear /PHPUnit2/Tests/Framework AssertTest.php
| From: | Sebastian Bergmann | Date: | Sat, 04 Mar 2006 18:53:42 +0000 |
| Subject: | cvs: pear /PHPUnit2/Tests/Framework AssertTest.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38911@lists.php.net to get a copy of this message | ||
sebastian Sat Mar 4 18:53:42 2006 UTC
Modified files:
/pear/PHPUnit2/Tests/Framework AssertTest.php
Log:
Add tests for assertHasProperty() and assertNotHasProperty().
http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Tests/Framework/AssertTest.php?r1=1.27&r2=1.28&diff_format=u
Index: pear/PHPUnit2/Tests/Framework/AssertTest.php
diff -u pear/PHPUnit2/Tests/Framework/AssertTest.php:1.27
pear/PHPUnit2/Tests/Framework/AssertTest.php:1.28
--- pear/PHPUnit2/Tests/Framework/AssertTest.php:1.27 Sat Mar 4 18:47:10 2006
+++ pear/PHPUnit2/Tests/Framework/AssertTest.php Sat Mar 4 18:53:42 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.27 2006/03/04 18:47:10 sebastian Exp $
+ * @version CVS: $Id: AssertTest.php,v 1.28 2006/03/04 18:53:42 sebastian Exp $
* @link http://pear.php.net/package/PHPUnit2
* @since File available since Release 2.0.0
*/
@@ -50,6 +50,7 @@
require_once '_files/ClassWithNonPublicProperties.php';
require_once '_files/TestIterator.php';
+require_once '_files/WasRun.php';
/**
*
@@ -446,6 +447,40 @@
$this->fail();
}
+ public function testAssertHasProperty()
+ {
+ $o = new WasRun('runTest');
+
+ $this->assertHasProperty('wasRun', $o);
+
+ try {
+ $this->assertHasProperty('foo', $o);
+ }
+
+ catch (PHPUnit2_Framework_AssertionFailedError $e) {
+ return;
+ }
+
+ $this->fail();
+ }
+
+ public function testAssertNotHasProperty()
+ {
+ $o = new WasRun('runTest');
+
+ $this->assertNotHasProperty('foo', $o);
+
+ try {
+ $this->assertNotHasProperty('wasRun', $o);
+ }
+
+ catch (PHPUnit2_Framework_AssertionFailedError $e) {
+ return;
+ }
+
+ $this->fail();
+ }
+
public function testAssertNull()
{
$this->assertNull(NULL);