Annotation of embedaddon/php/ext/date/tests/DateTime_getOffset_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test DateTime::getOffset() function : error conditions
! 3: --FILE--
! 4: <?php
! 5:
! 6: /* Prototype : public int DateTime::getOffset ( void )
! 7: * Description: Returns the daylight saving time offset
! 8: * Source code: ext/date/php_date.c
! 9: * Alias to functions: date_offset_get
! 10: */
! 11:
! 12: //Set the default time zone
! 13: date_default_timezone_set("Europe/London");
! 14:
! 15: echo "*** Testing DateTime::getOffset() : error conditions ***\n";
! 16:
! 17: echo "\n-- Testing DateTime::getOffset() function with more than expected no. of arguments --\n";
! 18: $datetime = new DateTime("2009-01-30 19:34:10");
! 19: $extra_arg = 30;
! 20:
! 21: var_dump( $datetime->getOffset($extra_arg) );
! 22:
! 23: ?>
! 24: ===DONE===
! 25: --EXPECTF--
! 26: *** Testing DateTime::getOffset() : error conditions ***
! 27:
! 28: -- Testing DateTime::getOffset() function with more than expected no. of arguments --
! 29:
! 30: Warning: DateTime::getOffset() expects exactly 0 parameters, 1 given in %s on line %d
! 31: bool(false)
! 32: ===DONE===
! 33:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>