summaryrefslogtreecommitdiff
path: root/ext/xml
diff options
context:
space:
mode:
authorMark Niebergall <mbniebergall@gmail.com>2019-02-10 19:50:58 +0100
committerPeter Kokot <peterkokot@gmail.com>2019-02-10 19:52:31 +0100
commite727facd4766d8eb42245f2ea3fb9a25ccf4fa5b (patch)
tree9fa7918646147c6f2907224f56592aafff6adc7b /ext/xml
parent76703ae5a1c7d5532ca2bed9ebb18976f07cbe9d (diff)
downloadphp-git-e727facd4766d8eb42245f2ea3fb9a25ccf4fa5b.tar.gz
Added test for xml_parser_set_option
- For skipping white space and triggering invalid encoding value error
Diffstat (limited to 'ext/xml')
-rw-r--r--ext/xml/tests/xml_parser_set_option_variation4.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/xml/tests/xml_parser_set_option_variation4.phpt b/ext/xml/tests/xml_parser_set_option_variation4.phpt
new file mode 100644
index 0000000000..da59a7eb9b
--- /dev/null
+++ b/ext/xml/tests/xml_parser_set_option_variation4.phpt
@@ -0,0 +1,25 @@
+--TEST--
+xml_parser_free - Test setting skip whitespace and invalid encoding type
+--CREDITS--
+Mark Niebergall <mbniebergall@gmail.com>
+PHP TestFest 2017 - UPHPU
+--SKIPIF--
+<?php
+if (!extension_loaded("xml")) {
+ print "skip - XML extension not loaded";
+}
+?>
+--FILE--
+<?php
+
+$xmlParser = xml_parser_create();
+
+var_dump(xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, 1));
+var_dump(xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'Invalid Encoding'));
+
+?>
+--EXPECTF--
+bool(true)
+
+Warning: xml_parser_set_option(): Unsupported target encoding "Invalid Encoding" in %s on line %d
+bool(false)