public static function get_handler_class() {
        global $CFG, $DB;

        if (PHPUNIT_TEST) {
            return '\core\session\file';
        } else if (!empty($CFG->session_handler_class)) {
            return $CFG->session_handler_class;
        } else if (!empty($CFG->dbsessions) and $DB->session_lock_supported()) {
            return '\core\session\database';
        }

        return '\core\session\file';
    }