See Release Notes
Long Term Support Release
Differences Between: [Versions 310 and 401] [Versions 39 and 401]
Unit Tests for sitepolicy manager
Copyright: | 2018 Marina Glancy |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 384 lines (15 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
sitepolicy_test:: (12 methods):
test_get_handler_classname()
test_is_defined()
test_get_redirect_url()
test_get_embed_url()
test_accept()
test_accept_guests()
get_mock_manager_with_handler()
test_is_defined_with_handler()
test_get_redirect_url_with_handler()
test_get_embed_url_with_handler()
test_accept_with_handler()
test_accept_guests_with_handler()
handler:: (4 methods):
is_defined()
get_redirect_url()
get_embed_url()
accept()
Class: sitepolicy_test - X-Ref
Unit Tests for sitepolicy managertest_get_handler_classname() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_handler_classname() behaviour. |
test_is_defined() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::is_defined() |
test_get_redirect_url() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() |
test_get_embed_url() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() |
test_accept() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() |
test_accept_guests() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() for guests |
get_mock_manager_with_handler() X-Ref |
Helper to spoof the results of the internal function get_all_handlers, allowing mock handler to be tested. return: PHPUnit_Framework_MockObject_MockObject |
test_is_defined_with_handler() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::is_defined() with a handler |
test_get_redirect_url_with_handler() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() with a handler |
test_get_embed_url_with_handler() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() with a handler |
test_accept_with_handler() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() with a handler |
test_accept_guests_with_handler() X-Ref |
Tests for \core_privacy\local\sitepolicy\manager::get_redirect_url() for guests with a handler |
is_defined($forguests = false) X-Ref |
Checks if the site has site policy defined param: bool $forguests return: bool |
get_redirect_url($forguests = false) X-Ref |
Returns URL to redirect user to when user needs to agree to site policy This is a regular interactive page for web users. It should have normal Moodle header/footers, it should allow user to view policies and accept them. param: bool $forguests return: moodle_url|null (returns null if site policy is not defined) |
get_embed_url($forguests = false) X-Ref |
Returns URL of the site policy that needs to be displayed to the user (inside iframe or to use in WS such as mobile app) This page should not have any header/footer, it does not also have any buttons/checkboxes. The caller needs to implement the "Accept" button and call {@link self::accept()} on completion. param: bool $forguests return: moodle_url|null |
accept() X-Ref |
Accept site policy for the current user return: bool - false if sitepolicy not defined, user is not logged in or user has already agreed to site policy; |