Skip to content

Commit 916dedf

Browse files
committed
Add additional test for special cases for C14N
1 parent 554f659 commit 916dedf

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--TEST--
2+
Test: Canonicalization with special nodes
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
$xml = <<<EOXML
8+
<?xml version="1.0"?>
9+
<!DOCTYPE doc [
10+
]>
11+
<doc xmlns="">
12+
<![CDATA[bar]]>
13+
<!-- x -->
14+
<temp xmlns=""/>
15+
<?pi-no-data ?>
16+
</doc>
17+
EOXML;
18+
19+
$dom = new DOMDocument();
20+
$dom->loadXML($xml);
21+
$doc = $dom->documentElement;
22+
echo $doc->C14N(withComments: true);
23+
echo $doc->C14N(withComments: false);
24+
25+
?>
26+
--EXPECT--
27+
<doc>
28+
bar
29+
<!-- x -->
30+
<temp></temp>
31+
<?pi-no-data?>
32+
</doc><doc>
33+
bar
34+
35+
<temp></temp>
36+
<?pi-no-data?>
37+
</doc>

0 commit comments

Comments
 (0)