1--TEST-- 2Test xml_set_character_data_handler() 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_set_character_data_handler(resource parser, string hdl) 12 * Description: Set up character data handler 13 * Source code: ext/xml/xml.c 14 * Alias to functions: 15 */ 16 17echo "*** Testing xml_set_character_data_handler() : error conditions ***\n"; 18 19 20//Test xml_set_character_data_handler with one more than the expected number of arguments 21echo "\n-- Testing xml_set_character_data_handler() function with more than expected no. of arguments --\n"; 22 23$hdl = 'string_val'; 24$extra_arg = 10; 25var_dump( xml_set_character_data_handler(null, $hdl, $extra_arg) ); 26 27// Testing xml_set_character_data_handler with one less than the expected number of arguments 28echo "\n-- Testing xml_set_character_data_handler() function with less than expected no. of arguments --\n"; 29 30var_dump( xml_set_character_data_handler(null) ); 31 32echo "Done"; 33?> 34--EXPECTF-- 35*** Testing xml_set_character_data_handler() : error conditions *** 36 37-- Testing xml_set_character_data_handler() function with more than expected no. of arguments -- 38 39Warning: xml_set_character_data_handler() expects exactly 2 parameters, 3 given in %s on line %d 40NULL 41 42-- Testing xml_set_character_data_handler() function with less than expected no. of arguments -- 43 44Warning: xml_set_character_data_handler() expects exactly 2 parameters, 1 given in %s on line %d 45NULL 46Done 47