Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]
(no description)
File Size: | 474 lines (19 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
externallib_test:: (13 methods):
setUp()
test_core_question_update_flag()
get_random_question_summaries_test_cases()
test_get_random_question_summaries_variations()
test_get_random_question_summaries_invalid_category_id_param()
test_get_random_question_summaries_invalid_includesubcategories_param()
test_get_random_question_summaries_invalid_tagids_param()
test_get_random_question_summaries_invalid_context()
test_get_random_question_summaries_restricted_context()
test_get_random_question_summaries_formats_returned_questions()
test_get_random_question_summaries_with_limit_and_offset()
test_get_random_question_summaries_without_capability()
create_category_and_questions()
Class: externallib_test - X-Ref
Question external functions testssetUp() X-Ref |
Set up for every test |
test_core_question_update_flag() X-Ref |
Test update question flag |
get_random_question_summaries_test_cases() X-Ref |
Data provider for the get_random_question_summaries test. |
test_get_random_question_summaries_variations($categoryindex,$includesubcategories,$usetagnames,$expectedquestionindexes) X-Ref |
Test the get_random_question_summaries function with various parameter combinations. This function creates a data set as follows: Category: cat1 Question: cat1q1 Tags: 'cat1', 'foo' Question: cat1q2 Category: cat2 Question: cat2q1 Tags: 'cat2', 'foo' Question: cat2q2 Category: subcat Question: subcatq1 Tags: 'subcat', 'foo' Question: subcatq2 Parent: cat1 Category: emptycat param: string $categoryindex The named index for the category to use param: bool $includesubcategories If the search should include subcategories param: string[] $usetagnames The tag names to include in the search param: string[] $expectedquestionindexes The questions expected in the result |
test_get_random_question_summaries_invalid_category_id_param() X-Ref |
get_random_question_summaries should throw an invalid_parameter_exception if not given an integer for the category id. |
test_get_random_question_summaries_invalid_includesubcategories_param() X-Ref |
get_random_question_summaries should throw an invalid_parameter_exception if not given a boolean for the $includesubcategories parameter. |
test_get_random_question_summaries_invalid_tagids_param() X-Ref |
get_random_question_summaries should throw an invalid_parameter_exception if not given an array of integers for the tag ids parameter. |
test_get_random_question_summaries_invalid_context() X-Ref |
get_random_question_summaries should throw an invalid_parameter_exception if not given a context. |
test_get_random_question_summaries_restricted_context() X-Ref |
get_random_question_summaries should throw an restricted_context_exception if the given context is outside of the set of restricted contexts the user is allowed to call external functions in. |
test_get_random_question_summaries_formats_returned_questions() X-Ref |
get_random_question_summaries should return a question that is formatted correctly. |
test_get_random_question_summaries_with_limit_and_offset() X-Ref |
get_random_question_summaries should allow limiting and offsetting of the result set. |
test_get_random_question_summaries_without_capability() X-Ref |
get_random_question_summaries should throw an exception if the user doesn't have the capability to use the questions in the requested category. |
create_category_and_questions($questioncount, $tagnames = [], $parentcategory = null) X-Ref |
Create a question category and create questions in that category. Tag the first question in each category with the given tags. param: int $questioncount How many questions to create. param: string[] $tagnames The list of tags to use. param: stdClass|null $parentcategory The category to set as the parent of the created category. return: array The category and questions. |