BUG Fix race conditions in DatetimeFieldTest

This commit is contained in:
Damian Mooyman 2017-05-25 12:13:04 +12:00
parent 0cd40ca6e5
commit 9c63a8c8ce
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -23,11 +23,14 @@ class DatetimeFieldTest extends SapphireTest
{ {
parent::setUp(); parent::setUp();
i18n::set_locale('en_NZ'); i18n::set_locale('en_NZ');
// Fix now to prevent race conditions
DBDatetime::set_mock_now('2010-04-04');
$this->timezone = date_default_timezone_get(); $this->timezone = date_default_timezone_get();
} }
protected function tearDown() protected function tearDown()
{ {
DBDatetime::clear_mock_now();
date_default_timezone_set($this->timezone); date_default_timezone_set($this->timezone);
parent::tearDown(); // TODO: Change the autogenerated stub parent::tearDown(); // TODO: Change the autogenerated stub
} }