Annotation of embedaddon/php/ext/standard/tests/strings/count_chars_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test count_chars() function : error conditions
3: --FILE--
4: <?php
5:
6: /* Prototype : mixed count_chars ( string $string [, int $mode ] )
7: * Description: Return information about characters used in a string
8: * Source code: ext/standard/string.c
9: */
10:
11: echo "*** Testing count_chars() : error conditions ***\n";
12:
13: echo "\n-- Testing count_chars() function with no arguments --\n";
14: var_dump( count_chars() );
15:
16: echo "\n-- Testing count_chars() function with more than expected no. of arguments --\n";
17: $string = "Hello World\n";
18: $mode = 1;
19: $extra_arg = 10;
20: var_dump( count_chars($string, $mode, $extra_arg) );
21:
22: ?>
23: ===DONE===
24: --EXPECTF--
25: *** Testing count_chars() : error conditions ***
26:
27: -- Testing count_chars() function with no arguments --
28:
29: Warning: count_chars() expects at least 1 parameter, 0 given in %s on line %d
30: NULL
31:
32: -- Testing count_chars() function with more than expected no. of arguments --
33:
34: Warning: count_chars() expects at most 2 parameters, 3 given in %s on line %d
35: NULL
36: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>