summaryrefslogtreecommitdiff
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
commit038ba91426c7d30df2ce5b84c408f0291398161b (patch)
tree1d3b2fbaf1c36c356579dce020ef373e2de50f2a
parentb07ad1e1a2721e030b589a38fb4d5758e2084cfe (diff)
downloadphp-git-038ba91426c7d30df2ce5b84c408f0291398161b.tar.gz
Rename and enhance test for bug 55253 now that bugs web is up.
-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