Annotation of embedaddon/php/ext/standard/tests/strings/chunk_split_error.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test chunk_split() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
6: * Description: Returns split line
7: * Source code: ext/standard/string.c
8: * Alias to functions: none
9: */
10:
11: /*
12: * Testing error conditions of chunk_split() with zero arguments
1.1.1.2 ! misho 13: * and for more than expected number of arguments
1.1 misho 14: */
15:
16: echo "*** Testing chunk_split() : error conditions ***\n";
17:
18: // Zero arguments
19: echo "-- Testing chunk_split() function with Zero arguments --";
20: var_dump( chunk_split() );
21:
22: // With one more than the expected number of arguments
23: $str = 'Testing chunk_split';
24: $chunklen = 5;
25: $ending = '***';
26: $extra_arg = 10;
27: echo "-- Testing chunk_split() function with more than expected no. of arguments --";
28: var_dump( chunk_split($str, $chunklen, $ending, $extra_arg) );
29:
30: echo "Done"
31: ?>
32: --EXPECTF--
33: *** Testing chunk_split() : error conditions ***
34: -- Testing chunk_split() function with Zero arguments --
35: Warning: chunk_split() expects at least 1 parameter, 0 given in %s on line %d
36: NULL
37: -- Testing chunk_split() function with more than expected no. of arguments --
38: Warning: chunk_split() expects at most 3 parameters, 4 given in %s on line %d
39: NULL
40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>