Skip to content

Commit

Permalink
Update TimeTest.php, add testTimeAgoInWordsTimezone
Browse files Browse the repository at this point in the history
Added a test case for the timezone option in function timeAgoInWords.
  • Loading branch information
icaroscherma committed Apr 22, 2015
1 parent 8a83521 commit fcf7408
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/TestCase/I18n/TimeTest.php
Expand Up @@ -174,7 +174,24 @@ public function timeAgoEndProvider()
],
];
}

/**
* test the timezone option for timeAgoInWords
*
* @return void
*/
public function testTimeAgoInWordsTimezone()
{
$time = new Time('1990-07-31 20:33:00 UTC');
$result = $time->timeAgoInWords(
[
'timezone' => 'America/Vancouver',
'end' => '+1month',
'format' => 'dd-MM-YYYY HH:mm:ss'
]
);
$this->assertEquals('on 31-07-1990 13:33:00', $result);
}

/**
* test the end option for timeAgoInWords
*
Expand Down

0 comments on commit fcf7408

Please sign in to comment.