1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00

Rename and enhance test for bug 55253 now that bugs web is up.

This commit is contained in:
Daniel Convissor
2011-07-20 18:24:14 +00:00
parent 946456425e
commit d31c5e8a4d

View File

@@ -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 <danielc@php.net>
--XFAIL--
Bug exists
Bug 55253 exists
--FILE--
<?php
@@ -24,6 +24,17 @@ $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
@@ -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