public function testHtml() { $tag = new Tag(); $this->assertEquals('<p>', $tag->openHtmlTag('p')); $this->assertEquals('<img src="test" alt="truc"/>', $tag->openHtmlTag('img', 'src="test" alt="truc"')); $this->assertEquals('<img/>', $tag->openHtmlTag('img')); $this->assertEquals('<br/>', $tag->openHtmlTag('br')); $this->assertEquals('</p>', $tag->closeHtmlTag('p')); $this->assertEquals('', $tag->closeHtmlTag('img')); $this->assertEquals('', $tag->closeHtmlTag('br')); }
/** * Parse closing tag. * * @param resource $parser XML parser * @param string $tag Tag name */ public function endTag($parser, $tag) { if (!array_pop($this->empty_tags) && $this->tag->isAllowedTag($tag)) { $this->output .= $this->tag->closeHtmlTag($tag); } }