danielc Wed, 20 Jul 2011 18:24:14 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=313484
Log: Rename and enhance test for bug 55253 now that bugs web is up. Bug: https://bugs.php.net/55253 (Open) DateTime::add() and sub() result -1 hour on objects with time zone type 2 Changed paths: D php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt A + php/php-src/branches/PHP_5_3/ext/date/tests/bug55253.phpt (from php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt:r312286) D php/php-src/branches/PHP_5_4/ext/date/tests/bug.add.zone2.phpt A + php/php-src/branches/PHP_5_4/ext/date/tests/bug55253.phpt (from php/php-src/branches/PHP_5_4/ext/date/tests/bug.add.zone2.phpt:r313482) D php/php-src/trunk/ext/date/tests/bug.add.zone2.phpt A + php/php-src/trunk/ext/date/tests/bug55253.phpt (from php/php-src/trunk/ext/date/tests/bug.add.zone2.phpt:r312289)
Deleted: php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt 2011-07-20 17:40:18 UTC (rev 313483) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt 2011-07-20 18:24:14 UTC (rev 313484) @@ -1,33 +0,0 @@ ---TEST-- -DateTime::add() mistakenly modifies objects having zone type 2 ---CREDITS-- -Daniel Convissor <dani...@php.net> ---XFAIL-- -Bug exists ---FILE-- -<?php - -date_default_timezone_set('America/New_York'); - -$interval = new DateInterval('PT2H1M'); - -$date3 = new DateTime('2010-10-04 02:18:48'); -$date2 = new DateTime('2010-10-04 02:18:48 EDT'); - -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"; - -echo $interval->format('Add %h hours %i minutes') . "\n"; -$date3->add($interval); -$date2->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"; - -?> ---EXPECT-- -Zone Type 3: 2010-10-04 02:18:48 EDT -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 Copied: php/php-src/branches/PHP_5_3/ext/date/tests/bug55253.phpt (from rev 312286, php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt) =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/bug55253.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug55253.phpt 2011-07-20 18:24:14 UTC (rev 313484) @@ -0,0 +1,47 @@ +--TEST-- +DateTime::add() and sub() result -1 hour on objects with time zone type 2 +--CREDITS-- +Daniel Convissor <dani...@php.net> +--XFAIL-- +Bug 55253 exists +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); + +$interval = new DateInterval('PT2H1M'); + +$date3 = new DateTime('2010-10-04 02:18:48'); +$date2 = new DateTime('2010-10-04 02:18:48 EDT'); + +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"; + +echo $interval->format('Add %h hours %i minutes') . "\n"; +$date3->add($interval); +$date2->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 +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 Deleted: php/php-src/branches/PHP_5_4/ext/date/tests/bug.add.zone2.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/bug.add.zone2.phpt 2011-07-20 17:40:18 UTC (rev 313483) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug.add.zone2.phpt 2011-07-20 18:24:14 UTC (rev 313484) @@ -1,33 +0,0 @@ ---TEST-- -DateTime::add() mistakenly modifies objects having zone type 2 ---CREDITS-- -Daniel Convissor <dani...@php.net> ---XFAIL-- -Bug exists ---FILE-- -<?php - -date_default_timezone_set('America/New_York'); - -$interval = new DateInterval('PT2H1M'); - -$date3 = new DateTime('2010-10-04 02:18:48'); -$date2 = new DateTime('2010-10-04 02:18:48 EDT'); - -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"; - -echo $interval->format('Add %h hours %i minutes') . "\n"; -$date3->add($interval); -$date2->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"; - -?> ---EXPECT-- -Zone Type 3: 2010-10-04 02:18:48 EDT -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 Copied: php/php-src/branches/PHP_5_4/ext/date/tests/bug55253.phpt (from rev 313482, php/php-src/branches/PHP_5_4/ext/date/tests/bug.add.zone2.phpt) =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/bug55253.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug55253.phpt 2011-07-20 18:24:14 UTC (rev 313484) @@ -0,0 +1,47 @@ +--TEST-- +DateTime::add() and sub() result -1 hour on objects with time zone type 2 +--CREDITS-- +Daniel Convissor <dani...@php.net> +--XFAIL-- +Bug 55253 exists +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); + +$interval = new DateInterval('PT2H1M'); + +$date3 = new DateTime('2010-10-04 02:18:48'); +$date2 = new DateTime('2010-10-04 02:18:48 EDT'); + +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"; + +echo $interval->format('Add %h hours %i minutes') . "\n"; +$date3->add($interval); +$date2->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 +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 Deleted: php/php-src/trunk/ext/date/tests/bug.add.zone2.phpt =================================================================== --- php/php-src/trunk/ext/date/tests/bug.add.zone2.phpt 2011-07-20 17:40:18 UTC (rev 313483) +++ php/php-src/trunk/ext/date/tests/bug.add.zone2.phpt 2011-07-20 18:24:14 UTC (rev 313484) @@ -1,33 +0,0 @@ ---TEST-- -DateTime::add() mistakenly modifies objects having zone type 2 ---CREDITS-- -Daniel Convissor <dani...@php.net> ---XFAIL-- -Bug exists ---FILE-- -<?php - -date_default_timezone_set('America/New_York'); - -$interval = new DateInterval('PT2H1M'); - -$date3 = new DateTime('2010-10-04 02:18:48'); -$date2 = new DateTime('2010-10-04 02:18:48 EDT'); - -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"; - -echo $interval->format('Add %h hours %i minutes') . "\n"; -$date3->add($interval); -$date2->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"; - -?> ---EXPECT-- -Zone Type 3: 2010-10-04 02:18:48 EDT -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 Copied: php/php-src/trunk/ext/date/tests/bug55253.phpt (from rev 312289, php/php-src/trunk/ext/date/tests/bug.add.zone2.phpt) =================================================================== --- php/php-src/trunk/ext/date/tests/bug55253.phpt (rev 0) +++ php/php-src/trunk/ext/date/tests/bug55253.phpt 2011-07-20 18:24:14 UTC (rev 313484) @@ -0,0 +1,47 @@ +--TEST-- +DateTime::add() and sub() result -1 hour on objects with time zone type 2 +--CREDITS-- +Daniel Convissor <dani...@php.net> +--XFAIL-- +Bug 55253 exists +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); + +$interval = new DateInterval('PT2H1M'); + +$date3 = new DateTime('2010-10-04 02:18:48'); +$date2 = new DateTime('2010-10-04 02:18:48 EDT'); + +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"; + +echo $interval->format('Add %h hours %i minutes') . "\n"; +$date3->add($interval); +$date2->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 +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
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php