Beispiel #1
0
 public function testUnsetAccessor()
 {
     $tag = new \r8\HTML\Tag("hr");
     unset($tag['rel']);
     $tag->setAttr("rel", "nofollow")->setAttr("class", "title");
     $this->assertSame(array("rel" => "nofollow", "class" => "title"), $tag->getAttrs());
     unset($tag['rel']);
     $this->assertSame(array("class" => "title"), $tag->getAttrs());
     try {
         unset($tag['  ']);
         $this->fail("An expected exception has not been thrown");
     } catch (\r8\Exception\Argument $err) {
         $this->assertEquals("Must not be empty", $err->getMessage());
     }
 }