Beispiel #1
0
 public function testGetAttrString()
 {
     $tag = new \r8\HTML\Tag("a");
     $this->assertSame("", $tag->getAttrString());
     $tag->setAttr("href", "?test=1&other=2");
     $this->assertSame('href="?test=1&other=2"', $tag->getAttrString());
     $tag->setAttr("selected");
     $this->assertSame('href="?test=1&other=2" selected', $tag->getAttrString());
     $tag->setAttr("Class", "link");
     $this->assertSame('href="?test=1&other=2" class="link" selected', $tag->getAttrString());
     $tag->setAttr("TITLE", "has \" ' quotes");
     $this->assertSame('href="?test=1&other=2" class="link" title="has " \' quotes" selected', $tag->getAttrString());
 }