Skip to content

Commit 0a00d47

Browse files
committed
added more tests for svg
1 parent 4b75717 commit 0a00d47

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

test/Html5Test.php

+39-9
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,46 @@ protected function cycleFragment($fragment)
3232
public function testImageTagsInSvg()
3333
{
3434
$html = "<!DOCTYPE html>
35-
<html>
36-
<body>
37-
<svg>
38-
<image />
39-
</svg>
40-
<image></image>
41-
</body>
42-
</html>";
35+
<html>
36+
<head>
37+
<title>foo</title>
38+
</head>
39+
<body>
40+
<svg>
41+
<image height=\"10\" width=\"10\"/>
42+
</svg>
43+
</body>
44+
</html>";
4345
$doc = $this->html5->loadHTML($html);
44-
$this->assertXmlStringEqualsXmlString($html, $this->html5->saveHTML($doc));
46+
$this->assertInstanceOf('DOMElement', $doc->getElementsByTagName('image')->item(0));
47+
48+
$html = "<!DOCTYPE html>
49+
<html>
50+
<head>
51+
<title>foo</title>
52+
</head>
53+
<body>
54+
<svg>
55+
<image height=\"10\" width=\"10\"></image>
56+
</svg>
57+
</body>
58+
</html>";
59+
$doc = $this->html5->loadHTML($html);
60+
$this->assertInstanceOf('DOMElement', $doc->getElementsByTagName('image')->item(0));
61+
62+
$html = "<!DOCTYPE html>
63+
<html>
64+
<head>
65+
<title>foo</title>
66+
</head>
67+
<body>
68+
<svg>
69+
<image height=\"10\" width=\"10\">
70+
</svg>
71+
</body>
72+
</html>>";
73+
$doc = $this->html5->loadHTML($html);
74+
$this->assertInstanceOf('DOMElement', $doc->getElementsByTagName('image')->item(0));
4575
}
4676

4777
public function testLoadOptions()

0 commit comments

Comments
 (0)