From 095e2df659c2636eeebfd87414da9264aca82c21 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Tue, 11 Jun 2013 22:22:24 -0400 Subject: Part of #4 and #7: Added normalization of element and attribute names to SVG and MathML output. --- test/HTML5/Serializer/OutputRulesTest.php | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'test/HTML5') diff --git a/test/HTML5/Serializer/OutputRulesTest.php b/test/HTML5/Serializer/OutputRulesTest.php index 4e1ce92..768434c 100644 --- a/test/HTML5/Serializer/OutputRulesTest.php +++ b/test/HTML5/Serializer/OutputRulesTest.php @@ -76,6 +76,11 @@ class OutputRulesTest extends \HTML5\Tests\TestCase {
foo bar baz
+ + + + + '); @@ -88,6 +93,24 @@ class OutputRulesTest extends \HTML5\Tests\TestCase { $this->assertEquals('
foo bar baz
', stream_get_contents($stream, -1, 0)); } + function testOpenTag() { + $dom = \HTML5::loadHTML(' + + +
foo bar baz
+ + '); + + $stream = fopen('php://temp', 'w'); + $t = new Traverser($dom, $stream, \HTML5::options()); + $o = new OutputRules($t, $stream, \HTML5::options()); + + $list = $dom->getElementsByTagName('div'); + $m = $this->getProtectedMethod('openTag'); + $m->invoke($o, $list->item(0)); + $this->assertEquals('
', stream_get_contents($stream, -1, 0)); + } + function testCData() { $dom = \HTML5::loadHTML(' @@ -175,4 +198,26 @@ class OutputRulesTest extends \HTML5\Tests\TestCase { $this->assertEquals('.+#', $m->invoke($o, '.+#')); } + function testSvg() { + $dom = \HTML5::loadHTML(' + + +
foo bar baz
+ + + + + + + '); + + $stream = fopen('php://temp', 'w'); + $t = new Traverser($dom, $stream, \HTML5::options()); + $o = new OutputRules($t, $stream, \HTML5::options()); + + $list = $dom->getElementsByTagName('svg'); + $o->element($list->item(0)); + $this->assertRegExp('||', stream_get_contents($stream, -1, 0)); + } + } \ No newline at end of file -- cgit v1.2.3