Annotation of embedaddon/php/ext/xml/tests/xml_error_string_error.phpt, revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>