Permalink
Browse files

Introducing failing test case to prove issue in CakeTime

  • Loading branch information...
lorenzo committed Sep 25, 2012
1 parent fe5b49e commit b0822d2246b6bad7dfb0c52b996dd8d5ea3ee036
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/Cake/Test/Case/Utility/CakeTimeTest.php
@@ -1049,4 +1049,19 @@ public function testListTimezones() {
}
}
/**
* Tests that using CakeTime::format() with the correct sytax actually converts
* from one timezone to the other correctly
*
* @return void
**/
public function testCorrectTimezoneConversion() {
date_default_timezone_set('UTC');
$date = '2012-01-01 10:00:00';
$converted = CakeTime::format($date, '%Y-%m-%d %H:%M:%S', '', 'Europe/Copenhagen');
$expected = new DateTime($date);
$expected->setTimezone(new DateTimeZone('Europe/Copenhagen'));
$this->assertEquals($expected->format('Y-m-d H:i:s'), $converted);
}
}

0 comments on commit b0822d2

Please sign in to comment.