From df53d5a53bcc5ca1a9ab9187daf3d6fdd3e3198f Mon Sep 17 00:00:00 2001 From: Michael Aherne Date: Thu, 25 Apr 2024 12:13:01 +0100 Subject: [PATCH] Skip test if gradingform_rubric_ranges not installed. --- tests/locallib_test.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/locallib_test.php b/tests/locallib_test.php index 3b4b8fa..0205c47 100644 --- a/tests/locallib_test.php +++ b/tests/locallib_test.php @@ -35,6 +35,7 @@ require_once($CFG->dirroot . '/report/advancedgrading/locallib.php'); use context_module; +use core_component; use core_grades\component_gradeitem; use gradingform_rubric_ranges_controller; use gradingform_rubric_ranges_generator; @@ -80,6 +81,7 @@ class locallib_test extends \advanced_testcase { * @var int */ public $assign; + private int $courseid; /** * Extract and install the mbz backup of a course @@ -257,6 +259,11 @@ public function test_guide() { */ public function test_rubric_ranges() { $this->resetAfterTest(); + + if (core_component::get_plugin_directory('gradingform', 'rubric_ranges') === null) { + $this->markTestSkipped('Rubric ranges plugin not installed'); + } + // Fetch generators. $generator = \testing_util::get_data_generator(); $rubricgenerator = $generator->get_plugin_generator('gradingform_rubric_ranges');