svn: /php/php-src/branches/PHP_5_3/ext/date/tests/ bug52290.phpt
| From: | Kai Schröder | Date: | Sat, 17 Jul 2010 21:57:16 +0000 |
| Subject: | svn: /php/php-src/branches/PHP_5_3/ext/date/tests/ bug52290.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-63155@lists.php.net to get a copy of this message | ||
k.schroeder Sat, 17 Jul 2010 21:57:16 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=301357
Log:
Test for #52290
Bug: http://bugs.php.net/52290 (Assigned) setDate,
setISODate, setTime works wrong when DateTime created from timestamp
Changed paths:
A php/php-src/branches/PHP_5_3/ext/date/tests/bug52290.phpt
Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug52290.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug52290.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug52290.phpt 2010-07-17 21:57:16 UTC (rev 301357)
@@ -0,0 +1,27 @@
+--TEST--
+Bug #52290 (setDate, setISODate, setTime works wrong when DateTime created from timestamp)
+--FILE--
+<?php
+$tz = 'UTC';
+date_default_timezone_set($tz);
+
+$ts = strtotime('2006-01-01');
+$dt = new DateTime('@'.$ts);
+$dt->setTimezone(new DateTimeZone($tz));
+
+var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
+
+$dt->setISODate(2005, 52, 1);
+var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
+
+$dt->setDate(2007, 10, 10);
+var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
+
+$dt->setTime(20, 30, 40);
+var_dump($dt->format('o-\WW-N | Y-m-d | H:i:s | U'));
+?>
+--EXPECTF--
+string(47) "2005-W52-7 | 2006-01-01 | 00:00:00 | 1136073600"
+string(47) "2005-W52-1 | 2005-12-26 | 00:00:00 | 1135555200"
+string(47) "2007-W40-5 | 2007-10-10 | 00:00:00 | 1191974400"
+string(47) "2007-W40-5 | 2007-10-10 | 20:30:40 | 1192048240"
\ No newline at end of file
Property changes on: php/php-src/branches/PHP_5_3/ext/date/tests/bug52290.phpt
___________________________________________________________________
Added: svn:keywords
+ Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
Added: svn:eol-style
+ native