-
Functional Test
-
Minor
-
Moodle 3.11
Prerequisites
- Set $CFG->autologinguests = 0; in config.php
- A course with students enrolled and an assignment activity.
Setup
We need to test each of them so we need repeat the steps below after setting each of the session handlers in our config.php:
- database session handler
- Log out if you are logged in
- Remove any config.php $CFG->session_handler_* stuff you previously added
- Paste this in your config.php before require_once...lib/setup.php
$CFG->session_handler_class = '\core\session\database';
$CFG->session_database_acquire_lock_timeout = 120;
- file session handler
- Log out if you are logged in
- Remove any config.php $CFG->session_handler_* stuff you previously added
- Paste this in your config.php before require_once...lib/setup.php
$CFG->session_handler_class = '\core\session\file';
$CFG->session_file_save_path = $CFG->dataroot.'/sessions';
Test
- Use the CLI to run php admin/cli/purge_caches.php
- Set it up according to config-dist.php instructions (you can also check Session_handling moodle docs page)
- Log in, go to a course and visit the gradebook (Grades).
- Filter the Grader report by First name.
- The table should only show users with the specified filter.
- Visit the course page, and then return to the gradebook (Grades). The filter for the first name should still be active.
- Open a different browser and log into the site with the same user.
- Go to the grades page. Note that no filters are currently set.
- Set the Surname filter. The results should be filtered according to the surname filter selected.
- On the first browser refresh the page. The filter should still remain as the first name and have no impact on the second browser.
- Log out (all opened sessions)
- Set http://YOURSITE/admin/index.php url in your browser, you should be redirected to the login page
- Log in as admin, you should be directed to admin/index.php