1--TEST--
2Test xml_parser_get_option() function : error conditions
3--SKIPIF--
4<?php
5if (!extension_loaded("xml")) {
6	print "skip - XML extension not loaded";
7}
8?>
9--FILE--
10<?php
11/* Prototype  : proto int xml_parser_get_option(resource parser, int option)
12 * Description: Get options from an XML parser
13 * Source code: ext/xml/xml.c
14 * Alias to functions:
15 */
16
17echo "*** Testing xml_parser_get_option() : error conditions ***\n";
18
19
20//Test xml_parser_get_option with one more than the expected number of arguments
21echo "\n-- Testing xml_parser_get_option() function with more than expected no. of arguments --\n";
22
23$option = 10;
24$extra_arg = 10;
25var_dump( xml_parser_get_option(null, $option, $extra_arg) );
26
27// Testing xml_parser_get_option with one less than the expected number of arguments
28echo "\n-- Testing xml_parser_get_option() function with less than expected no. of arguments --\n";
29
30var_dump( xml_parser_get_option(null) );
31echo "Done";
32?>
33--EXPECTF--
34*** Testing xml_parser_get_option() : error conditions ***
35
36-- Testing xml_parser_get_option() function with more than expected no. of arguments --
37
38Warning: xml_parser_get_option() expects exactly 2 parameters, 3 given in %s on line %d
39NULL
40
41-- Testing xml_parser_get_option() function with less than expected no. of arguments --
42
43Warning: xml_parser_get_option() expects exactly 2 parameters, 1 given in %s on line %d
44NULL
45Done
46