diff --git a/ext/dom/tests/xpath_context_node.phpt b/ext/dom/tests/xpath_context_node.phpt new file mode 100644 index 00000000000..8e60c8686d1 --- /dev/null +++ b/ext/dom/tests/xpath_context_node.phpt @@ -0,0 +1,31 @@ +--TEST-- +XPath: with a context node +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + +

bar

+
+ +

foo1

+

foo2

+
+ +XML); +$xpath = new DOMXpath($dom); + +foreach ($xpath->query("p", $dom->documentElement->firstElementChild->nextElementSibling) as $p) { + echo $p->textContent, "\n"; +} + +var_dump($xpath->evaluate("count(p)", $dom->documentElement->firstElementChild->nextElementSibling)); + +?> +--EXPECT-- +foo1 +foo2 +float(2)