From: Daniel Convissor Date: Wed, 20 Jul 2011 18:24:14 +0000 (+0000) Subject: Rename and enhance test for bug 55253 now that bugs web is up. X-Git-Tag: php-5.5.0alpha1~1750 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=038ba91426c7d30df2ce5b84c408f0291398161b;p=php Rename and enhance test for bug 55253 now that bugs web is up. --- diff --git a/ext/date/tests/bug.add.zone2.phpt b/ext/date/tests/bug55253.phpt similarity index 57% rename from ext/date/tests/bug.add.zone2.phpt rename to ext/date/tests/bug55253.phpt index 6b59eb434a..3c0efc4691 100755 --- a/ext/date/tests/bug.add.zone2.phpt +++ b/ext/date/tests/bug55253.phpt @@ -1,9 +1,9 @@ --TEST-- -DateTime::add() mistakenly modifies objects having zone type 2 +DateTime::add() and sub() result -1 hour on objects with time zone type 2 --CREDITS-- Daniel Convissor --XFAIL-- -Bug exists +Bug 55253 exists --FILE-- add($interval); echo 'Zone Type 3: ' . $date3->format('Y-m-d H:i:s T') . "\n"; echo 'Zone Type 2: ' . $date2->format('Y-m-d H:i:s T') . "\n"; +// Try subtracting from expected result. +$date3 = new DateTime('2010-10-04 04:19:48'); +$date2 = new DateTime('2010-10-04 04:19:48 EDT'); + +echo $interval->format('Subtract %h hours %i minutes from expected') . "\n"; +$date3->sub($interval); +$date2->sub($interval); + +echo 'Zone Type 3: ' . $date3->format('Y-m-d H:i:s T') . "\n"; +echo 'Zone Type 2: ' . $date2->format('Y-m-d H:i:s T') . "\n"; + ?> --EXPECT-- Zone Type 3: 2010-10-04 02:18:48 EDT @@ -31,3 +42,6 @@ Zone Type 2: 2010-10-04 02:18:48 EDT Add 2 hours 1 minutes Zone Type 3: 2010-10-04 04:19:48 EDT Zone Type 2: 2010-10-04 04:19:48 EDT +Subtract 2 hours 1 minutes from expected +Zone Type 3: 2010-10-04 02:18:48 EDT +Zone Type 2: 2010-10-04 02:18:48 EDT