Annotation of embedaddon/php/ext/date/tests/bug52290.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #52290 (setDate, setISODate, setTime works wrong when DateTime created from timestamp)
! 3: --FILE--
! 4: <?php
! 5: $tz = 'UTC';
! 6: date_default_timezone_set($tz);
! 7:
! 8: $ts = strtotime('2006-01-01');
! 9: $dt = new DateTime('@'.$ts);
! 10: $dt->setTimezone(new DateTimeZone($tz));
! 11:
! 12: var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
! 13:
! 14: $dt->setISODate(2005, 52, 1);
! 15: var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
! 16:
! 17: $dt->setDate(2007, 10, 10);
! 18: var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
! 19:
! 20: $dt->setTime(20, 30, 40);
! 21: var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
! 22: ?>
! 23: --EXPECTF--
! 24: string(47) "2005-W52-7 | 2006-01-01 | 00:00:00 | 1136073600"
! 25: string(47) "2005-W52-1 | 2005-12-26 | 00:00:00 | 1135555200"
! 26: string(47) "2007-W41-3 | 2007-10-10 | 00:00:00 | 1191974400"
! 27: string(47) "2007-W41-3 | 2007-10-10 | 20:30:40 | 1192048240"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>