From d3373cd5782b568211821e4c03711e1671bca8dc Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sun, 27 Oct 2024 15:13:48 +0100 Subject: [PATCH] Tests: Call parent setup() function when instantiating PHPUnit tests --- CHANGES.md | 4 ++++ tests/condition_test.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 37d493d..e70c7f4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ moodle-availability_cohort Changes ------- +### Unreleased + +* 2024-10-27 - Tests: Call parent setup() function when instantiating PHPUnit tests. + ### v4.3-r3 * 2024-08-23 - Bugfix: Fix 'Invalid database query parameter value' exception when restoring course with 'Any cohort' restriction, thanks to mi-dave. diff --git a/tests/condition_test.php b/tests/condition_test.php index 174b1d0..85aa9b3 100644 --- a/tests/condition_test.php +++ b/tests/condition_test.php @@ -38,9 +38,13 @@ final class condition_test extends \advanced_testcase { * Load required classes. */ public function setUp(): void { - // Load the mock info class so that it can be used. global $CFG; + + // Load the mock info class so that it can be used. require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php'); + + // Call parent setup. + parent::setUp(); } /**