diff --git a/src/I18n/DateFormatTrait.php b/src/I18n/DateFormatTrait.php index d89db14d287..2edf37e4670 100644 --- a/src/I18n/DateFormatTrait.php +++ b/src/I18n/DateFormatTrait.php @@ -355,9 +355,9 @@ public function jsonSerialize() 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 ]; } } diff --git a/tests/TestCase/Controller/Component/CookieComponentTest.php b/tests/TestCase/Controller/Component/CookieComponentTest.php index 9db61efd430..469191af711 100644 --- a/tests/TestCase/Controller/Component/CookieComponentTest.php +++ b/tests/TestCase/Controller/Component/CookieComponentTest.php @@ -294,7 +294,7 @@ public function testWriteFarFuture() $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', diff --git a/tests/TestCase/I18n/TimeTest.php b/tests/TestCase/I18n/TimeTest.php index 3b6d8b214a8..0aba4540ac5 100644 --- a/tests/TestCase/I18n/TimeTest.php +++ b/tests/TestCase/I18n/TimeTest.php @@ -604,9 +604,9 @@ public function testDebugInfo() { $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()); }