Annotation of embedaddon/php/ext/date/tests/013.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: date_date_set() tests
! 3: --FILE--
! 4: <?php
! 5: date_default_timezone_set('UTC');
! 6:
! 7: $dto = date_create("2006-12-12");
! 8: var_dump($dto);
! 9: var_dump($dto->format("Y.m.d H:i:s"));
! 10: var_dump(date_date_set());
! 11: var_dump($dto->format("Y.m.d H:i:s"));
! 12: var_dump(date_date_set($dto, 2006, 5));
! 13: var_dump($dto->format("Y.m.d H:i:s"));
! 14: var_dump(date_date_set($dto, 2006, 2, 15));
! 15: var_dump($dto->format("Y.m.d H:i:s"));
! 16: var_dump(date_date_set($dto, 2006, 24, 60));
! 17: var_dump($dto->format("Y.m.d H:i:s"));
! 18:
! 19: echo "Done\n";
! 20: ?>
! 21: --EXPECTF--
! 22: object(DateTime)#%d (3) {
! 23: ["date"]=>
! 24: string(19) "2006-12-12 00:00:00"
! 25: ["timezone_type"]=>
! 26: int(3)
! 27: ["timezone"]=>
! 28: string(3) "UTC"
! 29: }
! 30: string(19) "2006.12.12 00:00:00"
! 31:
! 32: Warning: date_date_set() expects exactly 4 parameters, 0 given in %s on line %d
! 33: bool(false)
! 34: string(19) "2006.12.12 00:00:00"
! 35:
! 36: Warning: date_date_set() expects exactly 4 parameters, 3 given in %s on line %d
! 37: bool(false)
! 38: string(19) "2006.12.12 00:00:00"
! 39: object(DateTime)#1 (3) {
! 40: ["date"]=>
! 41: string(19) "2006-02-15 00:00:00"
! 42: ["timezone_type"]=>
! 43: int(3)
! 44: ["timezone"]=>
! 45: string(3) "UTC"
! 46: }
! 47: string(19) "2006.02.15 00:00:00"
! 48: object(DateTime)#1 (3) {
! 49: ["date"]=>
! 50: string(19) "2008-01-29 00:00:00"
! 51: ["timezone_type"]=>
! 52: int(3)
! 53: ["timezone"]=>
! 54: string(3) "UTC"
! 55: }
! 56: string(19) "2008.01.29 00:00:00"
! 57: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>