summaryrefslogtreecommitdiff
path: root/ext/xml/tests/xml_parser_set_option_basic.phpt
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/xml/tests/xml_parser_set_option_basic.phpt
downloadphp2-c4dd7a1a684490673e25aaf4fabec5df138854c4.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/xml/tests/xml_parser_set_option_basic.phpt')
-rw-r--r--ext/xml/tests/xml_parser_set_option_basic.phpt57
1 files changed, 57 insertions, 0 deletions
diff --git a/ext/xml/tests/xml_parser_set_option_basic.phpt b/ext/xml/tests/xml_parser_set_option_basic.phpt
new file mode 100644
index 0000000..61316a4
--- /dev/null
+++ b/ext/xml/tests/xml_parser_set_option_basic.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Test xml_set_notation_decl_handler function : basic
+--SKIPIF--
+<?php
+if (!extension_loaded("xml")) {
+ print "skip - XML extension not loaded";
+}
+?>
+--FILE--
+<?php
+/* Prototype : proto bool xml_set_notation_decl_handler ( resource $parser , callback $handler )
+ * Description: Sets the notation declaration handler function for the XML parser.
+ * Source code: ext/xml/xml.c
+ * Alias to functions:
+ */
+
+echo "Simple testcase for xml_parser_get_option() function\n";
+
+$parser = xml_parser_create_ns();
+
+var_dump(xml_parser_get_option($parser, XML_OPTION_CASE_FOLDING));
+var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING));
+
+var_dump(xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 1));
+var_dump(xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1"));
+
+var_dump(xml_parser_get_option($parser, XML_OPTION_CASE_FOLDING));
+var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING));
+
+var_dump(xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0));
+var_dump(xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"));
+
+var_dump(xml_parser_get_option($parser, XML_OPTION_CASE_FOLDING));
+var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING));
+
+var_dump(xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "US-ASCII"));
+var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING));
+
+xml_parser_free( $parser );
+
+echo "Done\n";
+?>
+--EXPECT--
+Simple testcase for xml_parser_get_option() function
+int(1)
+string(5) "UTF-8"
+bool(true)
+bool(true)
+int(1)
+string(10) "ISO-8859-1"
+bool(true)
+bool(true)
+int(0)
+string(5) "UTF-8"
+bool(true)
+string(8) "US-ASCII"
+Done