Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

Privacy tests for core_calendar.

Copyright: 2018 Zig Tan <zig@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 833 lines (42 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: provider_test  - X-Ref

Unit tests for calendar/classes/privacy/provider

setUp()   X-Ref
Overriding setUp() function to always reset after tests.


test_get_contexts_for_userid()   X-Ref
Test for provider::get_contexts_for_userid().


test_export_user_data()   X-Ref
Test for provider::export_user_data().


test_export_user_preferences()   X-Ref
Test for provider::test_export_user_preferences().


test_delete_data_for_all_users_in_context()   X-Ref
Test for provider::delete_data_for_all_users_in_context().


test_delete_data_for_user()   X-Ref
Test for provider::delete_data_for_user().


test_get_users_in_context()   X-Ref
Test that only users with a user context are fetched.


test_delete_data_for_users()   X-Ref
Test that data for users in approved userlist is deleted.


create_test_standard_calendar_event($eventtype, $userid, $time, $customname = '', $categoryid = 0, $courseid = 0, $groupid = 0)   X-Ref
Helper function to create a Standard Calendar Event.

param: string    $eventtype  Calendar event type
param: int       $userid     User Id
param: int       $time       Timestamp value
param: string    $customname Custom name
param: int       $categoryid Course Category Id
param: int       $courseid   Course Id
param: int       $groupid    Group Id
return: bool|calendar_event  Standard Calendar Event created.

create_test_action_calendar_event($eventtype, $courseid, $instanceid, $modulename, $userid, $time)   X-Ref
Helper function to create an Action Calendar Event.

param: string    $eventtype  Calendar event type
param: int       $courseid   Course Id
param: int       $instanceid Activity Module instance id
param: string    $modulename Activity Module name
param: int       $userid     User Id
param: int       $time       Timestamp value
return: bool|calendar_event  Action Calendar Event created.

create_test_calendar_subscription($eventtype, $url, $userid, $categoryid = 0, $courseid = 0, $groupid = 0)   X-Ref
Helper function to create a Calendar Subscription.

param: string    $eventtype  Calendar Subscription event type
param: string    $url        Calendar Subscription URL
param: int       $userid     User Id
param: int       $categoryid Category Id
param: int       $courseid   Course Id
param: int       $groupid    Group Id
return: int  Calendar Subscription Id