diff options
author | Matt Farina <[email protected]> | 2016-05-10 10:04:04 -0400 |
---|---|---|
committer | Matt Farina <[email protected]> | 2016-05-10 10:04:04 -0400 |
commit | 1f11aa43170317f0f604663e56b6173f7cca03a1 (patch) | |
tree | 224e30a942690a8df14e3a4b129ccf8e9a50422f /test/HTML5/Serializer | |
parent | a6b1773f2ff6dad6c89fb3603d4d0d3970c53eed (diff) |
Adding test for the address tag
Diffstat (limited to 'test/HTML5/Serializer')
-rw-r--r-- | test/HTML5/Serializer/OutputRulesTest.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/HTML5/Serializer/OutputRulesTest.php b/test/HTML5/Serializer/OutputRulesTest.php index 72d1cd3..fc0e652 100644 --- a/test/HTML5/Serializer/OutputRulesTest.php +++ b/test/HTML5/Serializer/OutputRulesTest.php @@ -584,4 +584,33 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase $content = stream_get_contents($stream, - 1, 0); $this->assertRegExp('|<\?foo bar \?>|', $content); } + + public function testAddressTag() + { + $dom = $this->html5->loadHTML( + '<!doctype html> + <html lang="en"> + <body> + <address> + <a href="../People/Raggett/">Dave Raggett</a>, + <a href="../People/Arnaud/">Arnaud Le Hors</a>, + contact persons for the <a href="Activity">W3C HTML Activity</a> + </address> + </body> + </html>'); + + $stream = fopen('php://temp', 'w'); + $r = new OutputRules($stream, $this->html5->getOptions()); + $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); + + $list = $dom->getElementsByTagName('address'); + $r->element($list->item(0)); + $contents = stream_get_contents($stream, - 1, 0); + + $this->assertRegExp('|<address>|', $contents); + $this->assertRegExp('|<a href="../People/Raggett/">Dave Raggett</a>,|', $contents); + $this->assertRegExp('|<a href="../People/Arnaud/">Arnaud Le Hors</a>,|', $contents); + $this->assertRegExp('|contact persons for the <a href="Activity">W3C HTML Activity</a>|', $contents); + $this->assertRegExp('|</address>|', $contents); + } } |