Skip to content

Commit 03da81a

Browse files
committed
Merge pull request #111 from Masterminds/test-address
Adding test for the address tag
2 parents a6b1773 + 1f11aa4 commit 03da81a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/HTML5/Serializer/OutputRulesTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,4 +584,33 @@ public function testProcessorInstruction()
584584
$content = stream_get_contents($stream, - 1, 0);
585585
$this->assertRegExp('|<\?foo bar \?>|', $content);
586586
}
587+
588+
public function testAddressTag()
589+
{
590+
$dom = $this->html5->loadHTML(
591+
'<!doctype html>
592+
<html lang="en">
593+
<body>
594+
<address>
595+
<a href="../People/Raggett/">Dave Raggett</a>,
596+
<a href="../People/Arnaud/">Arnaud Le Hors</a>,
597+
contact persons for the <a href="Activity">W3C HTML Activity</a>
598+
</address>
599+
</body>
600+
</html>');
601+
602+
$stream = fopen('php://temp', 'w');
603+
$r = new OutputRules($stream, $this->html5->getOptions());
604+
$t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
605+
606+
$list = $dom->getElementsByTagName('address');
607+
$r->element($list->item(0));
608+
$contents = stream_get_contents($stream, - 1, 0);
609+
610+
$this->assertRegExp('|<address>|', $contents);
611+
$this->assertRegExp('|<a href="../People/Raggett/">Dave Raggett</a>,|', $contents);
612+
$this->assertRegExp('|<a href="../People/Arnaud/">Arnaud Le Hors</a>,|', $contents);
613+
$this->assertRegExp('|contact persons for the <a href="Activity">W3C HTML Activity</a>|', $contents);
614+
$this->assertRegExp('|</address>|', $contents);
615+
}
587616
}

0 commit comments

Comments
 (0)