Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Mar 26, 2017
1 parent 2f7974e commit d8849e5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/TestCase/Utility/TimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1186,18 +1186,23 @@ public function testTzOffset() {
Configure::write('Config.timezone', 'UTC');
date_default_timezone_set('UTC');

$this->Time = new Time();
$this->Time = new Time('2016-08-04');

$result = $this->Time->tzOffset(0, false);
$this->assertEquals(0, $result);

Configure::write('Config.timezone', 'Europe/Berlin');
date_default_timezone_set('Europe/Berlin');

$factor = date('I') ? 2 : 1;
$factor = date('I', $this->Time->getTimestamp());
$result = $this->Time->tzOffset($factor * HOUR, false);
$this->assertEquals(0, $result);

$this->Time = new Time('2016-02-04');
$factor = date('I', $this->Time->getTimestamp());
$result = $this->Time->tzOffset($factor * HOUR, false);
$this->assertEquals(-3600, $result);

Configure::write('Config.timezone', $timezone);
date_default_timezone_set($phpTimezone);
}
Expand Down

0 comments on commit d8849e5

Please sign in to comment.