From 481548f580ed1e09f64d072a1a6a00dd6ffa5279 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 4 Jul 2018 10:29:15 +0800 Subject: [PATCH] MDL-62834 behat: Move include to function --- lib/tests/behat/behat_filters.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/tests/behat/behat_filters.php b/lib/tests/behat/behat_filters.php index ce732d17b01d6..2b06662346829 100644 --- a/lib/tests/behat/behat_filters.php +++ b/lib/tests/behat/behat_filters.php @@ -23,11 +23,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. +// Note: You cannot use MOODLE_INTERNAL test here, or include files which do so. +// This file is required by behat before including /config.php. require_once(__DIR__ . '/../../behat/behat_base.php'); -require_once(__DIR__ . '/../../filterlib.php'); - /** * Steps definitions related to filters. @@ -48,6 +47,8 @@ class behat_filters extends behat_base { * @param string $statename 'on', 'off' or 'disabled'. */ public function the_filter_is($filtername, $statename) { + require_once(__DIR__ . '/../../filterlib.php'); + switch ($statename) { case 'on': $state = TEXTFILTER_ON;