Fixed DateTest timezone settings

Backport from 3.x, see d1a9e2b3 and 0aeda5c9
This commit is contained in:
Ingo Schommer 2012-12-04 12:36:43 +01:00
parent 3268c0dee8
commit f86bd977a4

View File

@ -10,14 +10,14 @@ class DateTest extends SapphireTest {
function setUp() {
// Set timezone to support timestamp->date conversion.
// We can't use date_default_timezone_set() as its not supported prior to PHP 5.2
$this->originalTZ = ini_get('date.timezone');
ini_set('date.timezone','Pacific/Auckland');
$this->originalTZ = date_default_timezone_get();
date_default_timezone_set('Pacific/Auckland');
parent::setUp();
}
function tearDown() {
ini_set('date.timezone',$this->originalTZ);
date_default_timezone_set($this->originalTZ);
parent::tearDown();
}