From: Derick Rethans Date: Mon, 30 Aug 2010 16:50:10 +0000 (+0000) Subject: - Keep 5.3 and trunk in sync. X-Git-Tag: php-5.4.0alpha1~191^2~1025 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9146218e2ef275fc215e3cc265669b26ef741561;p=php - Keep 5.3 and trunk in sync. --- diff --git a/ext/date/tests/bug52290.phpt b/ext/date/tests/bug52290.phpt new file mode 100644 index 0000000000..c1ee9d47af --- /dev/null +++ b/ext/date/tests/bug52290.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #52290 (setDate, setISODate, setTime works wrong when DateTime created from timestamp) +--FILE-- +setTimezone(new DateTimeZone($tz)); + +var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U')); + +$dt->setISODate(2005, 52, 1); +var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U')); + +$dt->setDate(2007, 10, 10); +var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U')); + +$dt->setTime(20, 30, 40); +var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U')); +?> +--EXPECTF-- +string(47) "2005-W52-7 | 2006-01-01 | 00:00:00 | 1136073600" +string(47) "2005-W52-1 | 2005-12-26 | 00:00:00 | 1135555200" +string(47) "2007-W40-5 | 2007-10-10 | 00:00:00 | 1191974400" +string(47) "2007-W40-5 | 2007-10-10 | 20:30:40 | 1192048240" \ No newline at end of file