Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]
Unit tests for (some of) mod/quiz/locallib.php.
Copyright: | 2008 Tim Hunt |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 947 lines (38 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
locallib_test:: (20 methods):
test_quiz_rescale_grade()
quiz_attempt_state_data_provider()
test_quiz_attempt_state()
test_quiz_question_tostring()
test_quiz_view()
test_quiz_is_overriden_calendar_event_no_override()
test_quiz_is_overriden_calendar_event_no_module_event()
test_quiz_is_overriden_calendar_event_different_quiz_instance()
test_quiz_is_overriden_calendar_event_user_override()
test_quiz_is_overriden_calendar_event_group_override()
test_quiz_get_user_timeclose()
setup_quiz_and_tags()
test_quiz_retrieve_slot_tags()
test_quiz_retrieve_slot_tags_with_removed_tag()
test_quiz_retrieve_slot_tags_for_standard_question()
test_quiz_retrieve_slot_tag_ids()
test_quiz_retrieve_slot_tag_ids_for_standard_question()
get_quiz_retrieve_tags_for_slot_ids_test_cases()
test_quiz_retrieve_tags_for_slot_ids_combinations()
test_quiz_override_summary()
Class: locallib_test - X-Ref
Unit tests for (some of) mod/quiz/locallib.php.test_quiz_rescale_grade() X-Ref |
No description |
quiz_attempt_state_data_provider() X-Ref |
No description |
test_quiz_attempt_state($attemptstate,$relativetimefinish, $relativetimeclose, $expectedstate) X-Ref |
param: unknown $attemptstate as in the quiz_attempts.state DB column. param: unknown $relativetimefinish time relative to now when the attempt finished, or null for 0. param: unknown $relativetimeclose time relative to now when the quiz closes, or null for 0. param: unknown $expectedstate expected result. One of the mod_quiz_display_options constants/ |
test_quiz_question_tostring() X-Ref |
No description |
test_quiz_view() X-Ref |
Test quiz_view return: void |
test_quiz_is_overriden_calendar_event_no_override() X-Ref |
Return false when there are not overrides for this quiz instance. |
test_quiz_is_overriden_calendar_event_no_module_event() X-Ref |
Return false if the given event isn't an quiz module event. |
test_quiz_is_overriden_calendar_event_different_quiz_instance() X-Ref |
Return false if there is overrides for this use but they belong to another quiz instance. |
test_quiz_is_overriden_calendar_event_user_override() X-Ref |
Return true if there is a user override for this event and quiz instance. |
test_quiz_is_overriden_calendar_event_group_override() X-Ref |
Return true if there is a group override for the event and quiz instance. |
test_quiz_get_user_timeclose() X-Ref |
Test test_quiz_get_user_timeclose(). |
setup_quiz_and_tags($qnum, $randomqnum, $questiontags = [], $unusedtags = []) X-Ref |
This function creates a quiz with some standard (non-random) and some random questions. The standard questions are created first and then random questions follow them. So in a quiz with 3 standard question and 2 random question, the first random question is at slot 4. param: int $qnum Number of standard questions that should be created in the quiz. param: int $randomqnum Number of random questions that should be created in the quiz. param: array $questiontags Tags to be used for random questions. param: string[] $unusedtags Some additional tags to be created. return: array An array of 2 elements: $quiz and $tagobjects. |
test_quiz_retrieve_slot_tags() X-Ref |
No description |
test_quiz_retrieve_slot_tags_with_removed_tag() X-Ref |
No description |
test_quiz_retrieve_slot_tags_for_standard_question() X-Ref |
No description |
test_quiz_retrieve_slot_tag_ids() X-Ref |
No description |
test_quiz_retrieve_slot_tag_ids_for_standard_question() X-Ref |
No description |
get_quiz_retrieve_tags_for_slot_ids_test_cases() X-Ref |
Data provider for the get_random_question_summaries test. |
test_quiz_retrieve_tags_for_slot_ids_combinations($questioncount,$randomquestioncount,$randomquestiontags,$unusedtags,$removeslottagids,$expected) X-Ref |
Test the quiz_retrieve_tags_for_slot_ids function with various parameter combinations. param: int $questioncount The number of regular questions to create param: int $randomquestioncount The number of random questions to create param: array $randomquestiontags The tags for the random questions param: string[] $unusedtags Additional tags to create to populate the DB with data param: int[] $removeslottagids Slot numbers to remove tag ids for param: array $expected The expected output of tag names indexed by slot number |
test_quiz_override_summary() X-Ref |
No description |