Skip to content

Commit 15fa7c6

Browse files
committed
Add template nesting test
1 parent 0ca7791 commit 15fa7c6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
<template> element nesting
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
8+
$html = <<<HTML
9+
<!DOCTYPE html>
10+
<html>
11+
<body>
12+
<template>foo<template>bar</template></template>
13+
</body>
14+
</html>
15+
HTML;
16+
$dom = Dom\HTMLDocument::createFromString($html);
17+
$template = $dom->body->firstElementChild;
18+
var_dump($template->innerHTML);
19+
echo $dom->saveXML();
20+
21+
?>
22+
--EXPECT--
23+
string(27) "foo<template>bar</template>"
24+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
25+
<!DOCTYPE html>
26+
<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>
27+
<template>foo<template>bar</template></template>
28+
29+
</body></html>

0 commit comments

Comments
 (0)