Annotation of embedaddon/php/ext/standard/tests/strings/ucwords_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test ucwords() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : string ucwords ( string $str )
6: * Description: Uppercase the first character of each word in a string
7: * Source code: ext/standard/string.c
8: */
9:
10: echo "*** Testing ucwords() : error conditions ***\n";
11:
12: // Zero argument
13: echo "\n-- Testing ucwords() function with Zero arguments --\n";
14: var_dump( ucwords() );
15:
16: // More than expected number of arguments
17: echo "\n-- Testing ucwords() function with more than expected no. of arguments --\n";
18: $str = 'string_val';
19: $extra_arg = 10;
20:
21: var_dump( ucwords($str, $extra_arg) );
22:
23: // check if there were any changes made to $str
24: var_dump($str);
25:
26: echo "Done\n";
27: ?>
28: --EXPECTF--
29: *** Testing ucwords() : error conditions ***
30:
31: -- Testing ucwords() function with Zero arguments --
32:
33: Warning: ucwords() expects exactly 1 parameter, 0 given in %s on line %d
34: NULL
35:
36: -- Testing ucwords() function with more than expected no. of arguments --
37:
38: Warning: ucwords() expects exactly 1 parameter, 2 given in %s on line %d
39: NULL
40: string(10) "string_val"
41: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>