danielc                                  Sat, 18 Jun 2011 01:00:56 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=312248

Log:
Provide test for DateTime::add() issue (for discussion on internals, 
bugs.php.net is down).

Changed paths:
    A   php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt

Added: 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              
                (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt      
2011-06-18 01:00:56 UTC (rev 312248)
@@ -0,0 +1,33 @@
+--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


Property changes on: 
php/php-src/branches/PHP_5_3/ext/date/tests/bug.add.zone2.phpt
___________________________________________________________________
Added: svn:executable
   + *

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to