Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Unit tests for parts of {@link question_engine_data_mapper}.

Copyright: 2014 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 254 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 question/engine/tests/helpers.php
 question/engine/lib.php

Defines 1 class


Class: question_engine_data_mapper_testcase  - X-Ref

Unit tests for parts of {@link question_engine_data_mapper}.

Note that many of the methods used when attempting questions, like
load_questions_usage_by_activity, insert_question_*, delete_steps are
tested elsewhere, e.g. by {@link question_usage_autosave_test}. We do not
re-test them here.

test_set_max_mark_in_attempts()   X-Ref
We create two usages, each with two questions, a short-answer marked
out of 5, and and essay marked out of 10. We just start these attempts.

Then we change the max mark for the short-answer question in one of the
usages to 20, using a qubaid_list, and verify.

Then we change the max mark for the essay question in the other
usage to 2, using a qubaid_join, and verify.

test_load_used_variants()   X-Ref
No description

test_repeated_usage_saving_new_usage()   X-Ref
No description

test_repeated_usage_saving_existing_usage()   X-Ref
No description

test_save_and_load_an_empty_usage()   X-Ref
Test that database operations on an empty usage work without errors.