Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Contains the class containing unit tests for the calendar lib.

Copyright: 2017 Mark Nelson <markn@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1044 lines (45 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 calendar/tests/helpers.php

Defines 1 class


Class: core_calendar_lib_testcase  - X-Ref

Class contaning unit tests for the calendar lib.

setUp()   X-Ref
Tests set up


test_get_events_with_disabled_module()   X-Ref
Test that the get_events() function only returns activity events that are enabled.


test_get_course_cached()   X-Ref
No description

test_update_subscription()   X-Ref
Test the update_subscription() function.


test_add_subscription()   X-Ref
No description

test_get_legacy_events_with_overrides()   X-Ref
Test for calendar_get_legacy_events() when there are user and group overrides.


test_calendar_get_default_courses()   X-Ref
No description

test_calendar_get_view_skip_events()   X-Ref
Confirm that the skip events flag causes the calendar_get_view function
to avoid querying for the calendar events.


test_calendar_get_allowed_event_types_course()   X-Ref
No description

test_calendar_get_allowed_event_types_group_no_acces_to_diff_groups()   X-Ref
No description

test_calendar_get_allowed_event_types_group_no_groups()   X-Ref
No description

test_calendar_get_allowed_event_types_group_access_all_groups()   X-Ref
No description

test_calendar_get_allowed_event_types_group_no_access_all_groups()   X-Ref
No description

test_calendar_get_allowed_event_types_group_cap_no_groups()   X-Ref
No description

test_calendar_get_allowed_event_types_group_cap_has_group()   X-Ref
No description

test_calendar_get_allowed_event_types_group_cap_access_all_groups()   X-Ref
No description

setup_test_calendar_set_filters()   X-Ref
This is a setup helper function that create some users, courses, groups and group memberships.
This is useful to prepare the environment for testing the calendar_set_filters function.

return: array An array of ($users, $courses, $coursegroups)

test_calendar_set_filters_not_logged_in()   X-Ref
This function tests calendar_set_filters for the case when user is not logged in.


test_calendar_set_filters_not_logged_in_with_user()   X-Ref
This function tests calendar_set_filters for the case when no one is logged in, but a user id is provided.


test_calendar_set_filters_logged_in_no_user()   X-Ref
This function tests calendar_set_filters for the case when user is logged in, but no user id is provided.


test_calendar_set_filters_logged_in_another_user()   X-Ref
This function tests calendar_set_filters for the case when a user is logged in, but another user id is provided.


test_calendar_view_event_allowed_course_event()   X-Ref
Test for calendar_view_event_allowed for course event types.


test_calendar_get_export_token_for_current_user()   X-Ref
Test for calendar_get_export_token for current user.


test_calendar_get_export_token_for_another_user()   X-Ref
Test for calendar_get_export_token for another user.


test_calendar_can_manage_user_event()   X-Ref
Test calendar_can_manage_user_event for different users.