summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/simplexml/tests')
-rw-r--r--ext/simplexml/tests/008.phpt9
-rw-r--r--ext/simplexml/tests/bug37076.phpt2
-rw-r--r--ext/simplexml/tests/bug37076_1.phpt2
-rw-r--r--ext/simplexml/tests/bug51615.phpt4
4 files changed, 16 insertions, 1 deletions
diff --git a/ext/simplexml/tests/008.phpt b/ext/simplexml/tests/008.phpt
index 4fda204a2..8734ba4a4 100644
--- a/ext/simplexml/tests/008.phpt
+++ b/ext/simplexml/tests/008.phpt
@@ -25,7 +25,10 @@ EOF;
$sxe = simplexml_load_string($xml);
var_dump($sxe->xpath("elem1/elem2/elem3/elem4"));
+//valid expression
var_dump($sxe->xpath("***"));
+//invalid expression
+var_dump($sxe->xpath("**"));
?>
--EXPECTF--
array(1) {
@@ -36,4 +39,10 @@ array(1) {
}
}
}
+array(0) {
+}
+
+Warning: SimpleXMLElement::xpath(): Invalid expression in %s on line %d
+
+Warning: SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed in %s on line %d
bool(false)
diff --git a/ext/simplexml/tests/bug37076.phpt b/ext/simplexml/tests/bug37076.phpt
index a5b3801cc..c7f19b3cc 100644
--- a/ext/simplexml/tests/bug37076.phpt
+++ b/ext/simplexml/tests/bug37076.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #37076 (SimpleXML ignores .=)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml = simplexml_load_string("<root><foo /></root>");
diff --git a/ext/simplexml/tests/bug37076_1.phpt b/ext/simplexml/tests/bug37076_1.phpt
index d2260040c..d4f4e0333 100644
--- a/ext/simplexml/tests/bug37076_1.phpt
+++ b/ext/simplexml/tests/bug37076_1.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #37076 (SimpleXML ignores .=) (appending to unnamed attribute)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml = simplexml_load_string("<root><foo /></root>");
diff --git a/ext/simplexml/tests/bug51615.phpt b/ext/simplexml/tests/bug51615.phpt
index 75f6769ff..94c7b20c4 100644
--- a/ext/simplexml/tests/bug51615.phpt
+++ b/ext/simplexml/tests/bug51615.phpt
@@ -1,7 +1,9 @@
--TEST--
Bug #51615 (PHP crash with wrong HTML in SimpleXML)
--SKIPIF--
-<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+<?php if (!extension_loaded("simplexml")) print "skip";
+ if (!extension_loaded("dom")) print "skip";
+?>
--FILE--
<?php