]> granicus.if.org Git - php/commitdiff
Tests for the default case of the parameter of xml_parser_get_option() and xml_parser...
authorSymeon Charalabides <symeon@systasis.com>
Wed, 22 Apr 2020 13:33:22 +0000 (15:33 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Wed, 22 Apr 2020 14:13:03 +0000 (16:13 +0200)
ext/xml/tests/xml_parser_get_option_variation4.phpt [new file with mode: 0644]
ext/xml/tests/xml_parser_set_option_variation5.phpt [new file with mode: 0644]

diff --git a/ext/xml/tests/xml_parser_get_option_variation4.phpt b/ext/xml/tests/xml_parser_get_option_variation4.phpt
new file mode 100644 (file)
index 0000000..9b3c773
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+xml_parser_get_option() - Test parameter not set
+--SKIPIF--
+<?php
+if (!extension_loaded('xml')) {
+    exit('Skip - XML extension not loaded');
+}
+?>
+--FILE--
+<?php
+
+$xmlParser = xml_parser_create();
+
+var_dump(xml_parser_get_option ($xmlParser, 42));
+
+?>
+--EXPECTF--
+Warning: xml_parser_get_option(): Unknown option in %s on line %d
+bool(false)
diff --git a/ext/xml/tests/xml_parser_set_option_variation5.phpt b/ext/xml/tests/xml_parser_set_option_variation5.phpt
new file mode 100644 (file)
index 0000000..0ef45d5
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+xml_parser_set_option() - Test invalid parameter
+--SKIPIF--
+<?php
+if (!extension_loaded('xml')) {
+    exit('Skip - XML extension not loaded');
+}
+?>
+--FILE--
+<?php
+
+$xmlParser = xml_parser_create();
+
+var_dump(xml_parser_set_option($xmlParser, 42, 1)); 
+
+?>
+--EXPECTF--
+Warning: xml_parser_set_option(): Unknown option in %s on line %d
+bool(false)