Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 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