From f69d98df43a55432adf839305281240a4e3e1a6a Mon Sep 17 00:00:00 2001 From: sam marshall Date: Tue, 11 Aug 2015 14:36:07 +0100 Subject: [PATCH] MDL-51077 Availability: Date restriction unit test static not cleared --- lib/phpunit/classes/util.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index b9f25d0f54f..ede3dfd0896 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -202,6 +202,12 @@ class phpunit_util extends testing_util { core_text::reset_caches(); get_message_processors(false, true); filter_manager::reset_caches(); + + // Reset static unit test options. + if (class_exists('\availability_date\condition', false)) { + \availability_date\condition::set_current_time_for_test(0); + } + // Reset internal users. core_user::reset_internal_users();