-
Functional Test
-
Minor
-
Moodle 3.2
Prerequisites
- autologinguest site setting disabled
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, set browser the url to calendar/view.php press enter and press "Hide group events"
- Open a session with the same user in another browser, leave the previous browser session opened
- Set the browser url to calendar/view.php press enter, group events should be visible, press "Hide course events"
- Return to the previous session and set the browser url to calendar/view.php press enter
- Group events should be hidden and course events should be visible
- Log out (last opened session)
- Open another session with a different user
- Go to calendar/view.php and check that all event types are visible by default
- 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