summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDaniel Convissor <danielc@php.net>2011-07-20 18:24:14 +0000
committerDaniel Convissor <danielc@php.net>2011-07-20 18:24:14 +0000
commitf7c269b1198ae987f48878b47ec3de5b35a58dc9 (patch)
tree9253c5470f3834a6e7dfeac3f558736b352d37de /ext
parent7907f66e4bb7015e33948e8b547f9c11fdf9ddd5 (diff)
downloadphp-git-f7c269b1198ae987f48878b47ec3de5b35a58dc9.tar.gz
Rename and enhance test for bug 55253 now that bugs web is up.
Diffstat (limited to 'ext')
-rwxr-xr-xext/date/tests/bug55253.phpt (renamed from ext/date/tests/bug.add.zone2.phpt)18
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/date/tests/bug.add.zone2.phpt b/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 <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