Annotation of embedaddon/php/ext/standard/tests/strings/chop_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test chop() function : error conditions 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string chop ( string $str [, string $charlist] )
                      6:  * Description: Strip whitespace (or other characters) from the end of a string
                      7:  * Source code: ext/standard/string.c
                      8: */
                      9: 
                     10: /*
                     11:  * Testing chop() : error conditions
                     12: */
                     13: 
                     14: echo "*** Testing chop() : error conditions ***\n";
                     15: 
                     16: // Zero argument
                     17: echo "\n-- Testing chop() function with Zero arguments --\n";
                     18: var_dump( chop() );
                     19: 
                     20: // More than expected number of arguments
                     21: echo "\n-- Testing chop() function with more than expected no. of arguments --\n";
                     22: $str = 'string_val ';
                     23: $charlist = 'string_val';
                     24: $extra_arg = 10;
                     25: 
                     26: var_dump( chop($str, $charlist, $extra_arg) );
                     27: var_dump( $str );
                     28: 
                     29: echo "Done\n";
                     30: ?>
                     31: --EXPECTF--
                     32: *** Testing chop() : error conditions ***
                     33: 
                     34: -- Testing chop() function with Zero arguments --
                     35: 
                     36: Warning: chop() expects at least 1 parameter, 0 given in %s on line %d
                     37: NULL
                     38: 
                     39: -- Testing chop() function with more than expected no. of arguments --
                     40: 
                     41: Warning: chop() expects at most 2 parameters, 3 given in %s on line %d
                     42: NULL
                     43: string(11) "string_val "
                     44: Done

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