Beispiel #1
0
 public function testConstruct()
 {
     $tag = new \r8\HTML\Tag("A");
     $this->assertSame("a", $tag->getTag());
     $this->assertNull($tag->getContent());
     try {
         $tag = new \r8\HTML\Tag("  ");
         $this->fail("An expected exception has not been thrown");
     } catch (\r8\Exception\Argument $err) {
         $this->assertEquals("Must not be empty", $err->getMessage());
     }
     $tag = new \r8\HTML\Tag("a", "a snip of content");
     $this->assertSame("a", $tag->getTag());
     $this->assertSame("a snip of content", $tag->getContent());
     $tag = new \r8\HTML\Tag("a", "a snip of content", array("href" => "#"));
     $this->assertSame("a", $tag->getTag());
     $this->assertSame("a snip of content", $tag->getContent());
     $this->assertSame(array("href" => "#"), $tag->getAttrs());
 }