Permalink
Browse files

Add tests for PHPUnit_Framework_Assert::assertAttributeEmpty() and PH…

…PUnit_Framework_Assert::assertAttributeNotEmpty().
  • Loading branch information...
1 parent 98ec75c commit b9c87cc5b14efd1754f8a25f6e98cd3fc2c65e71 @sebastianbergmann committed Jul 17, 2010
Showing with 44 additions and 0 deletions.
  1. +44 −0 Tests/Framework/AssertTest.php
@@ -4444,6 +4444,50 @@ public function testAssertNotEmpty()
}
/**
+ * @covers PHPUnit_Framework_Assert::assertAttributeEmpty
+ */
+ public function testAssertAttributeEmpty()
+ {
+ $o = new StdClass;
+ $o->a = array();
+
+ $this->assertAttributeEmpty('a', $o);
+
+ try {
+ $o->a = array('b');
+ $this->assertAttributeEmpty('a', $o);
+ }
+
+ catch (PHPUnit_Framework_AssertionFailedError $e) {
+ return;
+ }
+
+ $this->fail();
+ }
+
+ /**
+ * @covers PHPUnit_Framework_Assert::assertAttributeNotEmpty
+ */
+ public function testAssertAttributeNotEmpty()
+ {
+ $o = new StdClass;
+ $o->a = array('b');
+
+ $this->assertAttributeNotEmpty('a', $o);
+
+ try {
+ $o->a = array();
+ $this->assertAttributeNotEmpty('a', $o);
+ }
+
+ catch (PHPUnit_Framework_AssertionFailedError $e) {
+ return;
+ }
+
+ $this->fail();
+ }
+
+ /**
* @covers PHPUnit_Framework_Assert::markTestIncomplete
*/
public function testMarkTestIncomplete()

0 comments on commit b9c87cc

Please sign in to comment.