Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 400 and 401]

This file contains tests for the question_engine class.

Copyright: 2009 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 340 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: question_engine_test  - X-Ref

Unit tests for the question_engine class.

setUpBeforeClass()   X-Ref
Load required libraries.


test_load_behaviour_class()   X-Ref
Tests for load_behaviour_class.


test_load_behaviour_class_missing()   X-Ref
Tests for load_behaviour_class when a class is missing.


test_get_behaviour_unused_display_options(string $behaviour, array $expected)   X-Ref
Test the get_behaviour_unused_display_options with various options.

param: string $behaviour
param: array $expected

get_behaviour_unused_display_options_provider()   X-Ref
Data provider for get_behaviour_unused_display_options.

return: array

test_can_questions_finish_during_the_attempt(string $behaviour, bool $expected)   X-Ref
Tests for can_questions_finish_during_the_attempt.

param: string $behaviour
param: bool $expected

can_questions_finish_during_the_attempt_provider()   X-Ref
Data provider for can_questions_finish_during_the_attempt_provider.

return: array

test_sort_behaviours(array $input, array $expected)   X-Ref
Tests for sort_behaviours

param: array $input The params passed to sort_behaviours
param: array $expected

sort_behaviours_provider()   X-Ref
Data provider for sort_behaviours.

return: array

test_is_manual_grade_in_range(array $post, array $params, bool $expected)   X-Ref
Tests for is_manual_grade_in_range.

param: array $post The values to add to $_POST
param: array $params The params to pass to is_manual_grade_in_range
param: bool $expected

is_manual_grade_in_range_provider()   X-Ref
Data provider for is_manual_grade_in_range tests.

return: array

test_is_manual_grade_in_range_ungraded()   X-Ref
Tests for is_manual_grade_in_range.


test_render_question_number($value, string $expected)   X-Ref
Ensure that the number renderer performs as expected.

param: mixed $value
param: string $expected

render_question_number_provider()   X-Ref
Data provider for test_render_question_number.

return: array