From 580ab8704eee92bf1a615a7492d2c0d4776887cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Tue, 25 Jun 2024 22:20:24 +0200 Subject: [PATCH] MDL-82281 quiz: Amend test to circumvent modinfo cache fails. --- mod/quiz/tests/external/external_test.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/quiz/tests/external/external_test.php b/mod/quiz/tests/external/external_test.php index 151f8f11ecd..31c8265959e 100644 --- a/mod/quiz/tests/external/external_test.php +++ b/mod/quiz/tests/external/external_test.php @@ -243,6 +243,11 @@ final class external_test extends externallib_advanced_testcase { break; } } + + // Clear static cache and call get_fast_modinfo() again so that in the following cache should not be rebuilt. + \course_modinfo::clear_instance_cache(); + get_fast_modinfo($record->course); + $enrol->enrol_user($instance2, $this->student->id, $this->studentrole->id); self::setUser($this->student);