Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403] [Versions 402 and 403]
(no description)
File Size: | 1354 lines (64 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
modinfolib_test:: (22 methods):
test_section_info_properties()
test_cm_info_properties()
test_matching_cacherev()
test_cache_clear_wrong_cacherev()
test_cacherev_update_in_globals()
test_course_modinfo_properties()
test_is_user_access_restricted_by_capability()
test_cm_info_get_course_module_record()
test_cm_info_get_activitybadge()
test_availability_property()
test_get_groups()
test_create()
test_get_course_and_cm_from_cmid()
test_get_course_and_cm_from_instance()
test_get_section_info_by_id()
get_section_info_by_id_provider()
test_purge_section_cache_by_id()
test_section_cache_by_number()
test_purge_course_module()
test_purge_multiple_course_modules()
test_invalid_course_module_id()
test_get_modinfo_with_newer_version()
Class: modinfolib_test - X-Ref
Unit tests for lib/modinfolib.php.test_section_info_properties() X-Ref |
No description |
test_cm_info_properties() X-Ref |
No description |
test_matching_cacherev() X-Ref |
No description |
test_cache_clear_wrong_cacherev() X-Ref |
The cacherev is updated when we rebuild course cache, but there are scenarios where an existing course object with old cacherev might be reused within the same request after clearing the cache. In that case, we need to check that the new data is loaded and it does not reuse the old cached data with old cacherev. |
test_cacherev_update_in_globals() X-Ref |
When cacherev is updated for a course, it is supposed to update in the $COURSE and $SITE globals automatically. Check this is working. |
test_course_modinfo_properties() X-Ref |
No description |
test_is_user_access_restricted_by_capability() X-Ref |
No description |
test_cm_info_get_course_module_record() X-Ref |
Tests for function cm_info::get_course_module_record() |
test_cm_info_get_activitybadge() X-Ref |
Tests for function cm_info::get_activitybadge(). |
test_availability_property() X-Ref |
Tests the availability property that has been added to course modules and sections (just to see that it is correctly saved and accessed). |
test_get_groups() X-Ref |
Tests for get_groups() method. |
test_create() X-Ref |
Tests the function for constructing a cm_info from mixed data. |
test_get_course_and_cm_from_cmid() X-Ref |
Tests function for getting $course and $cm at once quickly from modinfo based on cmid or cm record. |
test_get_course_and_cm_from_instance() X-Ref |
Tests function for getting $course and $cm at once quickly from modinfo based on instance id or record. |
test_get_section_info_by_id(int $sectionnum,int $strictness = IGNORE_MISSING,bool $expectnull = false,bool $expectexception = false) X-Ref |
Test test_get_section_info_by_id method param: int $sectionnum the section number param: int $strictness the search strict mode param: bool $expectnull if the function will return a null param: bool $expectexception if the function will throw an exception |
get_section_info_by_id_provider() X-Ref |
Data provider for test_get_section_info_by_id(). return: array |
test_purge_section_cache_by_id() X-Ref |
Test purge_section_cache_by_id method return: void |
test_section_cache_by_number() X-Ref |
Test purge_section_cache_by_number method return: void |
test_purge_course_module() X-Ref |
Purge a single course module from the cache. return: void |
test_purge_multiple_course_modules() X-Ref |
Purge a multiple course modules from the cache. return: void |
test_invalid_course_module_id() X-Ref |
Test get_cm() method to output course module id in the exception text. return: void |
test_get_modinfo_with_newer_version() X-Ref |
Tests that if the modinfo cache returns a newer-than-expected version, Moodle won't rebuild it. This is important to avoid wasted time/effort and poor performance, for example in cases where multiple requests are accessing the course. Certain cases could be particularly bad if this test fails. For example, if using clustered databases where there is a 100ms delay between updates to the course table being available to all users (but no such delay on the cache infrastructure), then during that 100ms, every request that calls get_fast_modinfo and uses the read-only database will rebuild the course cache. Since these will then create a still-newer version, future requests for the next 100ms will also rebuild it again... etc. |