]> granicus.if.org Git - php/commitdiff
recovered original meaning of SXE xpath test
authorChristoph M. Becker <cmbecker69@gmx.de>
Sat, 30 May 2015 16:09:51 +0000 (18:09 +0200)
committerAnatol Belski <ab@php.net>
Sun, 31 May 2015 19:27:02 +0000 (21:27 +0200)
ext/simplexml/tests/SimpleXMLElement_xpath.phpt

index 4a613c2e510de5b6d206ef9899aa20ca00450154..fb7e6e90f0026a0ee218e36cdffc175efc532596 100644 (file)
@@ -2,7 +2,14 @@
 Testing xpath() with invalid XML
 --FILE--
 <?php
-$xml = @simplexml_load_string("XXXXXXX^",$x,0x6000000000000001);
+// gracefully recover from parsing of invalid XML; not available in PHP
+const XML_PARSE_RECOVER = 1;
+
+// we're not interested in checking concrete warnings regarding invalid XML
+$xml = @simplexml_load_string("XXXXXXX^", 'SimpleXMLElement', XML_PARSE_RECOVER);
+  
+// $xml is supposed to hold a SimpleXMLElement, but not FALSE/NULL
 var_dump($xml->xpath("BBBB"));
+?>
 --EXPECT--
 bool(false)