summaryrefslogtreecommitdiff
path: root/ext/xml/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-10-30 18:53:03 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2018-10-30 18:53:03 +0100
commit2816a3fdfa23cf0711251b8d1e9ffad3d281ea96 (patch)
treebd58786631ccf665f8937ee30c47e046e7a382e7 /ext/xml/tests
parent17df3a194b965256447fd253c46f0aaca4d5fdbd (diff)
downloadphp-git-2816a3fdfa23cf0711251b8d1e9ffad3d281ea96.tar.gz
Fix and improve test case
We fix the erroneous doctype declaration, clarify the expectation, and add a comment to clarify the purpose of the tag mismatch in the XML.
Diffstat (limited to 'ext/xml/tests')
-rw-r--r--ext/xml/tests/bug71592.phpt8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/xml/tests/bug71592.phpt b/ext/xml/tests/bug71592.phpt
index 28a316a28e..e76e7b4ef6 100644
--- a/ext/xml/tests/bug71592.phpt
+++ b/ext/xml/tests/bug71592.phpt
@@ -6,9 +6,11 @@ if (!extension_loaded('xml')) die('skip xml extension not available');
?>
--FILE--
<?php
+// The tag mismatch at the end of the XML is on purpose, to make sure that the
+// parser actually stops after the handler returns FALSE.
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE p [
+<!DOCTYPE root [
<!ENTITY pic PUBLIC "image.gif" "http://example.org/image.gif">
]>
<root>
@@ -22,9 +24,9 @@ xml_set_external_entity_ref_handler($parser, function () {
return false;
});
xml_parse($parser, $xml);
-var_dump(xml_get_error_code($parser));
+var_dump(xml_get_error_code($parser) === XML_ERROR_EXTERNAL_ENTITY_HANDLING);
?>
===DONE===
--EXPECT--
-int(21)
+bool(true)
===DONE===