MDL-25981 TEST PLAN =================== This plan shows the areas touched by the code changes, how, and recommends tests. Many of the tests are of the form 'should display the same as before'. In order to check these it will help to have the same system set up so you can toggle between 'before' this change and 'after'. For example you can do this by switching branches in git, or (more tediously) by backing up a course and restoring onto another server. I Reorganised get_fast_modinfo using classes AFFECTS: lib/modinfolib.php (new file that includes get_fast_modinfo + classes) lib/moodlelib.php (removing function) lib/setup.php (including new file) TO TEST: (No specific tests for this backend work; exercised by other tests below) II Label changes Changed the logic to remove hard-coding for label and use the new $cm->has_view() instead. AFFECTS: blocks/activity_modules/block_activity_modules.php course/report/outline/index.php course/report/participation/index.php lib/navigationlib.php lib/weblib.php (navmenulist function) lib/moodlelib.php (just adding the new FEATURE_NO_VIEW_LINK define) mod/label/lib.php (return true to new feature) TO TEST: 0. You need a course with at least one label and at least one forum. 1. If not already present, add the activity modules ('Activities') block to the course. Verify that labels are not shown but forums are. 2. From the course navigation select Reports/Activity report (this is the 'outline'). Verify that labels are not shown in the outline, but forums are. 3. Select Reports/Participation report. Click the first dropdown. Verify that the forums are included but labels are not. 4. Examine the navigation block 'General' and week sections, expanding weeks if necessary to see them. Verify that forums are included in the navigation block but labels are not. (Note: The navmenulist function does not appear to be used anywhere in core Moodle so there is no test for it.) III print_section and related changes Changed print_section to support the new modinfo stuff and remove corresponding hacks for label, forum. AFFECTS: course/lib.php (main print_section) plus two blocks that are based on copy-paste of some of the print_section code (and as a result are horrific - this change improves the situation / reduces duplication only slightly where changes were needed to make it work). blocks/site_main_menu/block_site_main_menu.php blocks/social_activities/block_social_activities.php TO TEST: 1. On the site home page, in the site main menu block, add a label and a forum. Verify that these both display correctly (=appear the same as before this change). 2. If necessary, create a test course that uses the 'social' format and has the 'social activities' block. Add a forum and a label to this block and verify that they both display correctly. 3. Set up a test scenario which demonstrates all print_section features as follows: - Enable the groupmembersonly and conditional activity availability features in site settings if necessary - Set up a test course as follows... - At least one student - Student belongs to group A which is include in grouping G1 - Student does not belong to group B which is included in grouping G2 - Normal forum - Normal label - Forum set to separate groups, grouping G1 and groupmembersonly - Forum set to separate groups, grouping G2 and groupmembersonly - Forum set to visible groups, grouping G2 and not groupmembersonly - Forum set to have availability from a future date, with 'show availability' option set to show it greyed out - Similar forum with 'show availability' option set to completely hide it 4. Using this test course, verify that it displays basically the same (i.e. with the same forums visible and not visible, the same explanations below them, etc) on system which does not include this code change, and on one which does. (This can be achieved e.g. in git by switching branch or something.) Do this check when logged in as admin and when logged in as the student. IV Login changes AFFECTS: lib/moodlelib.php (changes to use ->uservisible) TO TEST: 1. Using the test course created above: - Log in as the student. - Follow links to all the forums the student can see, and verify it lets them access them. - Follow links (e.g. from a tab kept open when logged in as admin) to all the forums the student cannot see, and verify that it doesn't let the student access them (it should say they're hidden) V Forum tidying AFFECTS: mod/forum/lib.php (new function forum_cm_info_view, basically == code that was in print_section) TO TEST: 1. Using the test course created above: - Set student profile to enable unread tracking - As admin, post a message in the normal forum so that it'll be unread for the student. 2. Login as the student and verify that the '1 unread' displays correctly (same as before change) [end]