Browse Source

Accomodate immutable dates and use named formats.

Use the proper ISO-8601 formats.
Mark Story 10 years ago
parent
commit
8deb66f03c

+ 2 - 2
src/I18n/DateFormatTrait.php

@@ -355,9 +355,9 @@ trait DateFormatTrait
     public function __debugInfo()
     {
         return [
-            'time' => $this->format(DateTime::ISO8601),
+            'time' => $this->toIso8601String(),
             'timezone' => $this->getTimezone()->getName(),
-            'fixedNowTime' => $this->hasTestNow() ? $this->getTestNow()->format(DateTime::ISO8601) : false
+            'fixedNowTime' => $this->hasTestNow() ? $this->getTestNow()->toIso8601String() : false
         ];
     }
 }

+ 1 - 1
tests/TestCase/Controller/Component/CookieComponentTest.php

@@ -294,7 +294,7 @@ class CookieComponentTest extends TestCase
         $this->Cookie->configKey('Testing', 'expires', '+90 years');
         $this->Cookie->write('Testing', 'value');
         $future = new Time('now');
-        $future->modify('+90 years');
+        $future = $future->modify('+90 years');
 
         $expected = [
             'name' => 'Testing',

+ 2 - 2
tests/TestCase/I18n/TimeTest.php

@@ -604,9 +604,9 @@ class TimeTest extends TestCase
     {
         $time = new Time('2014-04-20 10:10:10');
         $expected = [
-            'time' => '2014-04-20T10:10:10+0000',
+            'time' => '2014-04-20T10:10:10+00:00',
             'timezone' => 'UTC',
-            'fixedNowTime' => Time::getTestNow()->toISO8601String()
+            'fixedNowTime' => Time::getTestNow()->toIso8601String()
         ];
         $this->assertEquals($expected, $time->__debugInfo());
     }