Annotation of embedaddon/php/ext/date/tests/date_create_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test date_create() function : error conditions
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : DateTime date_create ([ string $time [, DateTimeZone $timezone ]] )
! 6: * Description: Returns new DateTime object
! 7: * Source code: ext/date/php_date.c
! 8: * Alias to functions: DateTime::__construct
! 9: */
! 10:
! 11: echo "*** Testing date_create() : error conditions ***\n";
! 12:
! 13: echo "\n-- Testing date_create() function with more than expected no. of arguments --\n";
! 14: $time = "GMT";
! 15: $timezone = timezone_open("GMT");
! 16: $extra_arg = 99;
! 17: var_dump( date_create($time, $timezone, $extra_arg) );
! 18:
! 19: ?>
! 20: ===DONE===
! 21: --EXPECTF--
! 22: *** Testing date_create() : error conditions ***
! 23:
! 24: -- Testing date_create() function with more than expected no. of arguments --
! 25:
! 26: Warning: date_create() expects at most 2 parameters, 3 given in %s on line %d
! 27: bool(false)
! 28: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>