Skip to content

Commit

Permalink
MDL-69624 question: add missing test required library.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Jan 13, 2022
1 parent e78184d commit 3c90926
Showing 1 changed file with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,30 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace core_question;

defined('MOODLE_INTERNAL') || die();

global $CFG;
require_once(__DIR__ . '/../lib.php');

use advanced_testcase;
use moodle_exception;
use question_engine;
use testable_core_question_renderer;

/**
*Unit tests for the question_engine class.
* Unit tests for the question_engine class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_engine_test extends advanced_testcase {

/**
* Load required libraries
*/
public static function setUpBeforeClass(): void {
global $CFG;

require_once("{$CFG->dirroot}/question/engine/lib.php");
}

public function test_load_behaviour_class() {
// Exercise SUT
question_engine::load_behaviour_class('deferredfeedback');
Expand Down Expand Up @@ -131,7 +140,9 @@ public function test_is_manual_grade_in_range_ungraded() {
}

public function test_render_question_number() {
global $PAGE;
global $CFG, $PAGE;

require_once("{$CFG->dirroot}/question/engine/tests/helpers.php");
$renderer = new testable_core_question_renderer($PAGE, 'core_question');

// Test with number is i character.
Expand Down

0 comments on commit 3c90926

Please sign in to comment.