Skip to content

Commit

Permalink
Add tests for TimeHelper::format() with Time and tz.
Browse files Browse the repository at this point in the history
Refs #7736
  • Loading branch information
markstory committed Nov 28, 2015
1 parent 380a466 commit 2f758b0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/TestCase/View/Helper/TimeHelperTest.php
Expand Up @@ -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.
Expand Down

0 comments on commit 2f758b0

Please sign in to comment.