Skip to content

Commit

Permalink
Skip test if gradingform_rubric_ranges not installed.
Browse files Browse the repository at this point in the history
Skip test if gradingform_rubric_ranges not installed.
  • Loading branch information
micaherne committed Apr 25, 2024
1 parent da8cb68 commit 7ce1321
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/locallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -81,6 +82,11 @@ class locallib_test extends \advanced_testcase {
*/
public $assign;

/**
* @var int the id of the generated course
*/
private int $courseid;

/**
* Extract and install the mbz backup of a course
* containing assignments using the advanced grading
Expand Down Expand Up @@ -257,6 +263,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');
Expand Down

0 comments on commit 7ce1321

Please sign in to comment.