Browse Source

Add tests for TimeHelper::format() with Time and tz.

Refs #7736
Mark Story 10 years ago
parent
commit
2f758b0127
1 changed files with 13 additions and 0 deletions
  1. 13 0
      tests/TestCase/View/Helper/TimeHelperTest.php

+ 13 - 0
tests/TestCase/View/Helper/TimeHelperTest.php

@@ -434,6 +434,19 @@ class TimeHelperTest extends TestCase
     }
 
     /**
+     * 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.
      *