From 9c63a8c8ce2910b7690c3cfb0ed70f95d8a1d205 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 25 May 2017 12:13:04 +1200 Subject: [PATCH] BUG Fix race conditions in DatetimeFieldTest --- tests/php/Forms/DatetimeFieldTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/php/Forms/DatetimeFieldTest.php b/tests/php/Forms/DatetimeFieldTest.php index 6cb8057d9..03e668bcb 100644 --- a/tests/php/Forms/DatetimeFieldTest.php +++ b/tests/php/Forms/DatetimeFieldTest.php @@ -23,11 +23,14 @@ class DatetimeFieldTest extends SapphireTest { parent::setUp(); i18n::set_locale('en_NZ'); + // Fix now to prevent race conditions + DBDatetime::set_mock_now('2010-04-04'); $this->timezone = date_default_timezone_get(); } protected function tearDown() { + DBDatetime::clear_mock_now(); date_default_timezone_set($this->timezone); parent::tearDown(); // TODO: Change the autogenerated stub }