Annotation of embedaddon/php/ext/date/tests/DateTime_construct_basic1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test new DateTime() : basic functionality
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : DateTime::__construct ([ string $time="now" [, DateTimeZone $timezone=NULL ]] )
! 6: * Description: Returns new DateTime object
! 7: * Source code: ext/date/php_date.c
! 8: * Alias to functions:
! 9: */
! 10:
! 11: //Set the default time zone
! 12: date_default_timezone_set("Europe/London");
! 13:
! 14: echo "*** Testing new DateTime() : basic functionality ***\n";
! 15:
! 16: var_dump( new DateTime('') );
! 17:
! 18: var_dump( new DateTime("GMT") );
! 19: var_dump( new DateTime("2005-07-14 22:30:41") );
! 20: var_dump( new DateTime("2005-07-14 22:30:41 GMT") );
! 21:
! 22: ?>
! 23: ===DONE===
! 24: --EXPECTF--
! 25: *** Testing new DateTime() : basic functionality ***
! 26: object(DateTime)#%d (3) {
! 27: ["date"]=>
! 28: string(%d) "%s"
! 29: ["timezone_type"]=>
! 30: int(3)
! 31: ["timezone"]=>
! 32: string(13) "Europe/London"
! 33: }
! 34: object(DateTime)#%d (3) {
! 35: ["date"]=>
! 36: string(%d) "%s"
! 37: ["timezone_type"]=>
! 38: int(2)
! 39: ["timezone"]=>
! 40: string(3) "GMT"
! 41: }
! 42: object(DateTime)#%d (3) {
! 43: ["date"]=>
! 44: string(19) "2005-07-14 22:30:41"
! 45: ["timezone_type"]=>
! 46: int(3)
! 47: ["timezone"]=>
! 48: string(13) "Europe/London"
! 49: }
! 50: object(DateTime)#%d (3) {
! 51: ["date"]=>
! 52: string(19) "2005-07-14 22:30:41"
! 53: ["timezone_type"]=>
! 54: int(2)
! 55: ["timezone"]=>
! 56: string(3) "GMT"
! 57: }
! 58: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>