1482eabc6SRaghubansh Kumar--TEST--
2782352c5SPeter KokotTest chunk_split() function : error conditions
3482eabc6SRaghubansh Kumar--FILE--
4482eabc6SRaghubansh Kumar<?php
5482eabc6SRaghubansh Kumar/* Prototype  : string chunk_split(string $str [, int $chunklen [, string $ending]])
6482eabc6SRaghubansh Kumar * Description: Returns split line
7482eabc6SRaghubansh Kumar * Source code: ext/standard/string.c
8482eabc6SRaghubansh Kumar * Alias to functions: none
9482eabc6SRaghubansh Kumar*/
10482eabc6SRaghubansh Kumar
11482eabc6SRaghubansh Kumar/*
12782352c5SPeter Kokot* Testing error conditions of chunk_split() with zero arguments
13782352c5SPeter Kokot* and for more than expected number of arguments
14482eabc6SRaghubansh Kumar*/
15482eabc6SRaghubansh Kumar
16482eabc6SRaghubansh Kumarecho "*** Testing chunk_split() : error conditions ***\n";
17482eabc6SRaghubansh Kumar
18482eabc6SRaghubansh Kumar// Zero arguments
19482eabc6SRaghubansh Kumarecho "-- Testing chunk_split() function with Zero arguments --";
20482eabc6SRaghubansh Kumarvar_dump( chunk_split() );
21482eabc6SRaghubansh Kumar
22482eabc6SRaghubansh Kumar// With one more than the expected number of arguments
23482eabc6SRaghubansh Kumar$str = 'Testing chunk_split';
24482eabc6SRaghubansh Kumar$chunklen = 5;
25482eabc6SRaghubansh Kumar$ending = '***';
26482eabc6SRaghubansh Kumar$extra_arg = 10;
27482eabc6SRaghubansh Kumarecho "-- Testing chunk_split() function with more than expected no. of arguments --";
28482eabc6SRaghubansh Kumarvar_dump( chunk_split($str, $chunklen, $ending, $extra_arg) );
29482eabc6SRaghubansh Kumar
30482eabc6SRaghubansh Kumarecho "Done"
31482eabc6SRaghubansh Kumar?>
32482eabc6SRaghubansh Kumar--EXPECTF--
33482eabc6SRaghubansh Kumar*** Testing chunk_split() : error conditions ***
34482eabc6SRaghubansh Kumar-- Testing chunk_split() function with Zero arguments --
35ed5a424bSDmitry StogovWarning: chunk_split() expects at least 1 parameter, 0 given in %s on line %d
36482eabc6SRaghubansh KumarNULL
37482eabc6SRaghubansh Kumar-- Testing chunk_split() function with more than expected no. of arguments --
38ed5a424bSDmitry StogovWarning: chunk_split() expects at most 3 parameters, 4 given in %s on line %d
39482eabc6SRaghubansh KumarNULL
40482eabc6SRaghubansh KumarDone
41