summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Farina <[email protected]>2013-06-09 21:53:24 -0400
committerMatt Farina <[email protected]>2013-06-09 21:53:24 -0400
commit7f1d9189bd12e808c5da236d32b89ddf3c7cc2d3 (patch)
treec9d41e2ed0ac4a1784e07ec871462b4c94b11877
parentb2789f5546c5153acc4186e9eeac9c25f329763f (diff)
Added test for doctype method on outputrules.
-rw-r--r--test/HTML5/Serializer/OutputRulesTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/HTML5/Serializer/OutputRulesTest.php b/test/HTML5/Serializer/OutputRulesTest.php
index 3d4e842..4e1ce92 100644
--- a/test/HTML5/Serializer/OutputRulesTest.php
+++ b/test/HTML5/Serializer/OutputRulesTest.php
@@ -58,6 +58,18 @@ class OutputRulesTest extends \HTML5\Tests\TestCase {
$this->assertEquals("<!DOCTYPE html>\n<html lang=\"en\"><body>foo</body></html>\n", stream_get_contents($stream, -1, 0));
}
+ function testDoctype() {
+ $dom = \HTML5::loadHTML('<!doctype html><html lang="en"><body>foo</body></html>');
+
+ $stream = fopen('php://temp', 'w');
+ $t = new Traverser($dom, $stream, \HTML5::options());
+ $o = new OutputRules($t, $stream, \HTML5::options());
+
+ $m = $this->getProtectedMethod('doctype');
+ $m->invoke($o, 'foo');
+ $this->assertEquals("<!DOCTYPE html>\n", stream_get_contents($stream, -1, 0));
+ }
+
function testElement() {
$dom = \HTML5::loadHTML('<!doctype html>