Annotation of embedaddon/php/ext/ereg/tests/spliti_error_001.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test spliti() function : error conditions - wrong number of args
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : proto array spliti(string pattern, string string [, int limit])
! 6: * Description: spliti string into array by regular expression
! 7: * Source code: ext/standard/reg.c
! 8: * Alias to functions:
! 9: */
! 10:
! 11: echo "*** Testing spliti() : error conditions - wrong number of args ***\n";
! 12:
! 13:
! 14: //Test spliti with one more than the expected number of arguments
! 15: echo "\n-- Testing spliti() function with more than expected no. of arguments --\n";
! 16: $pattern = 'string_val';
! 17: $string = 'string_val';
! 18: $limit = 10;
! 19: $extra_arg = 10;
! 20: var_dump( spliti($pattern, $string, $limit, $extra_arg) );
! 21:
! 22: // Testing spliti with one less than the expected number of arguments
! 23: echo "\n-- Testing spliti() function with less than expected no. of arguments --\n";
! 24: $pattern = 'string_val';
! 25: var_dump( spliti($pattern) );
! 26:
! 27: echo "Done";
! 28: ?>
! 29: --EXPECTF--
! 30: *** Testing spliti() : error conditions - wrong number of args ***
! 31:
! 32: -- Testing spliti() function with more than expected no. of arguments --
! 33:
! 34: Deprecated: Function spliti() is deprecated in %s on line %d
! 35:
! 36: Warning: spliti() expects at most 3 parameters, 4 given in %s on line %d
! 37: NULL
! 38:
! 39: -- Testing spliti() function with less than expected no. of arguments --
! 40:
! 41: Deprecated: Function spliti() is deprecated in %s on line %d
! 42:
! 43: Warning: spliti() expects at least 2 parameters, 1 given in %s on line %d
! 44: NULL
! 45: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>