From 21e8f813dc9f3dd247190825d35d2bcc6a9a5eba Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 12 Feb 2015 10:15:44 +0800 Subject: [PATCH] MDL-48670 behat: Set timezone to Australia/perth Behat tests might rely on time related tests Ensure we have default timezone set to Australia/Perth --- lib/setup.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/setup.php b/lib/setup.php index 9c93a42e673..d0a77601fdf 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -133,6 +133,11 @@ if (defined('BEHAT_SITE_RUNNING')) { } } +// Force timezone to be Australia/Perth for behat tests, so we don't get time zone problems. +if (defined('BEHAT_SITE_RUNNING') || defined('BEHAT_TEST') || defined('BEHAT_UTIL')) { + @date_default_timezone_set('Australia/Perth'); +} + // Normalise dataroot - we do not want any symbolic links, trailing / or any other weirdness there if (!isset($CFG->dataroot)) { if (isset($_SERVER['REMOTE_ADDR'])) {