diff --git a/tests/TestCase/View/Helper/TimeHelperTest.php b/tests/TestCase/View/Helper/TimeHelperTest.php index aa8989a3dec..2e9c13e6242 100644 --- a/tests/TestCase/View/Helper/TimeHelperTest.php +++ b/tests/TestCase/View/Helper/TimeHelperTest.php @@ -433,6 +433,19 @@ public function testFormat() $this->assertEquals($expected, $result); } + /** + * Test format() with a Time instance. + * + * @return void + */ + public function testFormatTimeInstance() + { + $time = new Time('2010-01-14 13:59:28', 'UTC'); + $result = $this->Time->format($time, 'HH:mm', null, 'America/New_York'); + $expected = '08:59'; + $this->assertTimeFormat($expected, $result); + } + /** * Custom assert to allow for variation in the version of the intl library, where * some translations contain a few extra commas.