Annotation of embedaddon/php/ext/date/tests/checkdate_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test checkdate() function : error conditions
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : bool checkdate ( int $month , int $day , int $year )
! 6: * Description: Validate a Gregorian date
! 7: * Source code: ext/date/php_date.c
! 8: * Alias to functions:
! 9: */
! 10:
! 11: echo "*** Testing checkdate() : error conditions ***\n";
! 12:
! 13: //Set the default time zone
! 14: date_default_timezone_set("America/Chicago");
! 15:
! 16: $arg_0 = 1;
! 17: $arg_1 = 1;
! 18: $arg_2 = 1;
! 19: $extra_arg = 1;
! 20:
! 21: echo "\n-- Testing checkdate() function with more than expected no. of arguments --\n";
! 22: var_dump (checkdate($arg_0, $arg_1, $arg_2, $extra_arg));
! 23:
! 24: echo "\n-- Testing checkdate() function with less than expected no. of arguments --\n";
! 25: var_dump (checkdate());
! 26: var_dump (checkdate($arg_0));
! 27: var_dump (checkdate($arg_0, $arg_1));
! 28:
! 29: ?>
! 30: ===DONE===
! 31: --EXPECTF--
! 32: *** Testing checkdate() : error conditions ***
! 33:
! 34: -- Testing checkdate() function with more than expected no. of arguments --
! 35:
! 36: Warning: checkdate() expects exactly 3 parameters, 4 given in %s on line %d
! 37: bool(false)
! 38:
! 39: -- Testing checkdate() function with less than expected no. of arguments --
! 40:
! 41: Warning: checkdate() expects exactly 3 parameters, 0 given in %s on line %d
! 42: bool(false)
! 43:
! 44: Warning: checkdate() expects exactly 3 parameters, 1 given in %s on line %d
! 45: bool(false)
! 46:
! 47: Warning: checkdate() expects exactly 3 parameters, 2 given in %s on line %d
! 48: bool(false)
! 49: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>