Deleted Added
full compact
chunk_split_error.phpt (3e94ce6a) chunk_split_error.phpt (04145dc2)
1tree 3e94ce6a:
1--TEST--
2Test 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*/
2
10
3.gdbinit
4CODING_STANDARDS
5CREDITS
6ChangeLog
7ChangeLog.1999.gz
8ChangeLog.2000.gz
9ChangeLog.2001.gz
10ChangeLog.2002.gz
11ChangeLog.2003.gz
12ChangeLog.2004.gz
13EXTENSIONS
14INSTALL
15LICENSE
16Makefile.frag
17Makefile.gcov
18Makefile.global
19NEWS
20README.CVS-RULES
21README.EXTENSIONS
22README.EXT_SKEL
23README.PARAMETER_PARSING_API
24README.PHP4-TO-PHP5-THIN-CHANGES
25README.QNX
26README.SELF-CONTAINED-EXTENSIONS
27README.STREAMS
28README.SUBMITTING_PATCH
29README.TESTING
30README.TESTING2
31README.UNIX-BUILD-SYSTEM
32README.UPDATE_5_2
33README.WIN32-BUILD-SYSTEM
34README.Zeus
35README.input_filter
36TODO
37TODO-5.1
38TODO-PHP5
39UPGRADING
40acconfig.h.in
41acinclude.m4
42buildconf
43buildconf.bat
44config.guess
45config.sub
46configure.in
47cvsclean
48cvsclean.bat
49footer
50genfiles
51header
52ltmain.sh
53makedist
54makerpm
55php.gif
56php.ini-dist
57php.ini-recommended
58php5.spec.in
59run-tests.php
60server-tests-config.php
61server-tests.php
62snapshot
63stamp-h.in
64stub.c
11/*
12* Testing error conditions of chunk_split() with zero arguments
13* and for more than expected number of arguments
14*/
15
16echo "*** Testing chunk_split() : error conditions ***\n";
17
18// Zero arguments
19echo "-- Testing chunk_split() function with Zero arguments --";
20var_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;
27echo "-- Testing chunk_split() function with more than expected no. of arguments --";
28var_dump( chunk_split($str, $chunklen, $ending, $extra_arg) );
29
30echo "Done"
31?>
32--EXPECTF--
33*** Testing chunk_split() : error conditions ***
34-- Testing chunk_split() function with Zero arguments --
35Warning: chunk_split() expects at least 1 parameter, 0 given in %s on line %d
36NULL
37-- Testing chunk_split() function with more than expected no. of arguments --
38Warning: chunk_split() expects at most 3 parameters, 4 given in %s on line %d
39NULL
40Done