Permalink
Browse files

Fix TimeHelper tests failing due to timezone changes.

  • Loading branch information...
1 parent baaae6c commit df76ff47e3bc0551922e56530887612df27b45c2 @predominant predominant committed Apr 13, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 cake/tests/cases/libs/view/helpers/time.test.php
@@ -662,7 +662,8 @@ function testConvertSpecifiers() {
), true);
Configure::write('Config.language', 'time_test');
$time = 1263487419; // Thu Jan 14 11:43:39 2010
- $time = strtotime('-5 hours', $time);
+ $offset = 5 * 60 * 60;
+ $time = $time - date('Z') - $offset - (date('I', $time) * 60 * 60);
$result = $this->Time->convertSpecifiers('%a', $time);
$expected = 'jue';
@@ -753,7 +754,8 @@ function testI18nFormat() {
), true);
Configure::write('Config.language', 'time_test');
$time = 1263495568; //Thu Jan 14 13:59:28 2010
- $time = strtotime('-5 hours', $time);
+ $offset = 5 * 60 * 60;
+ $time = $time - date('Z') - $offset - (date('I', $time) * 60 * 60);
$result = $this->Time->i18nFormat($time);
$expected = '14/01/10';

0 comments on commit df76ff4

Please sign in to comment.