diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
| commit | 993e1866df547532a05ab6db76c9ff5aefc9a3df (patch) | |
| tree | 169d3bde0974235d3cde164786ef6f381a4749a7 /ext/dom/tests | |
| parent | 1f589a2bd44ba835ad1b009a5d83abd453724829 (diff) | |
| download | php-upstream/5.2.6.tar.gz | |
Imported Upstream version 5.2.6upstream/5.2.6
Diffstat (limited to 'ext/dom/tests')
| -rw-r--r-- | ext/dom/tests/bug36756.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug38474.phpt | 7 | ||||
| -rw-r--r-- | ext/dom/tests/bug43364.phpt | 40 |
3 files changed, 47 insertions, 2 deletions
diff --git a/ext/dom/tests/bug36756.phpt b/ext/dom/tests/bug36756.phpt index af7488d3f..4e47b86e4 100644 --- a/ext/dom/tests/bug36756.phpt +++ b/ext/dom/tests/bug36756.phpt @@ -31,5 +31,5 @@ child Warning: Couldn't fetch DOMElement. Node no longer exists in %sbug36756.php on line %d -Notice: Undefined property: DOMElement::$nodeType in %sbug36756.php on line %d +Notice: Undefined property: DOMElement::$nodeType in %sbug36756.php on line %d nodeType: diff --git a/ext/dom/tests/bug38474.phpt b/ext/dom/tests/bug38474.phpt index 7febd22d3..5c1c1abd1 100644 --- a/ext/dom/tests/bug38474.phpt +++ b/ext/dom/tests/bug38474.phpt @@ -1,7 +1,12 @@ --TEST-- Bug #38474 (getAttribute select attribute by order, even when prefixed) (OK to fail with libxml2 < 2.6.2x) --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +if (version_compare(LIBXML_DOTTED_VERSION, "2.6.20", "<")) { + print "skip libxml version " . LIBXML_DOTTED_VERSION; +} +?> --FILE-- <?php $xml = '<node xmlns:pre="http://foo.com/tr/pre" diff --git a/ext/dom/tests/bug43364.phpt b/ext/dom/tests/bug43364.phpt new file mode 100644 index 000000000..0df581b7a --- /dev/null +++ b/ext/dom/tests/bug43364.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #43364 (recursive xincludes don't remove internal xml nodes properly) +--FILE-- +<?php +function loopElements($nodes) +{ + $count = 0; + foreach($nodes as $node) { + if($node instanceof DOMElement) { + $count++; + if($node->childNodes->length > 0) { + $count += loopElements($node->childNodes); + } + } + } + return $count; +} + +$xml = <<<DOC +<?xml version="1.0" encoding="UTF-8"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <a> + <a_child1>ac1</a_child1> + <a_child2>ac2</a_child2> + </a> + <b><xi:include xpointer="xpointer(/root/a)" /></b> + <c><xi:include xpointer="xpointer(/root/b)" /></c> +</root> +DOC; + +$doc = new DomDocument(); +$doc->loadXml($xml); +$doc->xinclude(); + +$count = loopElements(array($doc->documentElement)); + +var_dump($count); +?> +--EXPECT-- +int(13) |
