]> granicus.if.org Git - php/commitdiff
Add regression test for XPath support
authorMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 3 Nov 2003 22:49:24 +0000 (22:49 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 3 Nov 2003 22:49:24 +0000 (22:49 +0000)
ext/simplexml/tests/008.phpt [new file with mode: 0644]

diff --git a/ext/simplexml/tests/008.phpt b/ext/simplexml/tests/008.phpt
new file mode 100644 (file)
index 0000000..14912a6
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+SimpleXML and XPath 
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php 
+$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml');
+var_dump($sxe->xsearch("elem1/elem2/elem3/elem4"));
+var_dump($sxe->xsearch("***"));
+?>
+--EXPECTF--
+array(1) {
+  [0]=>
+  object(simplexml_element)#%d (1) {
+    ["test"]=>
+    object(simplexml_element)#%d (0) {
+    }
+  }
+}
+bool(false)