Annotation of embedaddon/php/ext/ctype/tests/ctype_cntrl_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test ctype_cntrl() function : error conditions - Incorrect number of args
! 3: --SKIPIF--
! 4: <?php require_once('skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7: /* Prototype : bool ctype_cntrl(mixed $c)
! 8: * Description: Checks for control character(s)
! 9: * Source code: ext/ctype/ctype.c
! 10: */
! 11:
! 12: /*
! 13: * Pass an incorrect number of arguments to ctype_cntrl() to test behaviour
! 14: */
! 15:
! 16: echo "*** Testing ctype_cntrl() : error conditions ***\n";
! 17:
! 18: // Zero arguments
! 19: echo "\n-- Testing ctype_cntrl() function with Zero arguments --\n";
! 20: var_dump( ctype_cntrl() );
! 21:
! 22: //Test ctype_cntrl with one more than the expected number of arguments
! 23: echo "\n-- Testing ctype_cntrl() function with more than expected no. of arguments --\n";
! 24: $c = 1;
! 25: $extra_arg = 10;
! 26: var_dump( ctype_cntrl($c, $extra_arg) );
! 27: ?>
! 28: ===DONE===
! 29: --EXPECTF--
! 30: *** Testing ctype_cntrl() : error conditions ***
! 31:
! 32: -- Testing ctype_cntrl() function with Zero arguments --
! 33:
! 34: Warning: ctype_cntrl() expects exactly 1 parameter, 0 given in %s on line %d
! 35: NULL
! 36:
! 37: -- Testing ctype_cntrl() function with more than expected no. of arguments --
! 38:
! 39: Warning: ctype_cntrl() expects exactly 1 parameter, 2 given in %s on line %d
! 40: NULL
! 41: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>