From a396321e449035a6211d47325f61a366165f7add Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Wed, 14 Sep 2016 10:46:19 +0800 Subject: [PATCH] MDL-55117 behat: Re-initialise to ensure modified config is not used As behat cli process is 1 run for features Any modification in will be reflected in later runs on cli. In this case - disabling enablebadges in block_badges.feature - reflected while running cron in award_badges.feature --- lib/behat/classes/util.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/behat/classes/util.php b/lib/behat/classes/util.php index ff700091942..c0c03633c50 100644 --- a/lib/behat/classes/util.php +++ b/lib/behat/classes/util.php @@ -345,5 +345,9 @@ class behat_util extends testing_util { // Inform data generator. self::get_data_generator()->reset(); + + // Initialise $CFG with default values. This is needed for behat cli process, so we don't have modified + // $CFG values from the old run. @see set_config. + initialise_cfg(); } }