Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

This file contains the class that handles testing of the calendar event vault.

Copyright: 2017 Ryan Wyllie <ryan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1218 lines (48 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_calendar_event_vault_testcase  - X-Ref

This file contains the class that handles testing of the calendar event vault.

test_get_action_events_by_timesort_after_time()   X-Ref
Test that get_action_events_by_timesort returns events after the
provided timesort value.


test_get_action_events_by_timesort_before_time()   X-Ref
Test that get_action_events_by_timesort returns events before the
provided timesort value.


test_get_action_events_by_timesort_between_time()   X-Ref
Test that get_action_events_by_timesort returns events between the
provided timesort values.


test_get_action_events_by_timesort_between_time_after_event()   X-Ref
Test that get_action_events_by_timesort returns events between the
provided timesort values and after the last seen event when one is
provided.


test_get_action_events_by_timesort_between_time_skip_even_records()   X-Ref
Test that get_action_events_by_timesort returns events between the
provided timesort values and the last seen event can be provided to
get paginated results.


test_get_action_events_by_timesort_between_time_skip_first_records()   X-Ref
Test that get_action_events_by_timesort returns events between the
provided timesort values. The database will continue to be read until the
number of events requested has been satisfied. In this case the first
five events are rejected so it should require two database requests.


test_get_action_events_by_timesort_non_consecutive_ids()   X-Ref
Test that get_action_events_by_timesort returns events between the
provided timesort values and after the last seen event when one is
provided. This should work even when the event ids aren't ordered the
same as the timesort order.


test_get_action_events_by_timesort_with_identical_group_override_priorities()   X-Ref
There are subtle cases where the priority of an event override may be identical to another.
For example, if you duplicate a group override, but make it apply to a different group. Now
there are two overrides with exactly the same overridden dates. In this case the priority of
both is 1.

In this situation:
- A user in group A should see only the A override
- A user in group B should see only the B override
- A user in both A and B should see both

test_get_action_events_by_timesort_with_suspended_user()   X-Ref
Test that if a user is suspended that events related to that course are not shown.
User 1 is suspended. User 2 is active.


test_get_action_events_by_course_after_time()   X-Ref
Test that get_action_events_by_course returns events after the
provided timesort value.


test_get_action_events_by_course_before_time()   X-Ref
Test that get_action_events_by_course returns events before the
provided timesort value.


test_get_action_events_by_course_between_time()   X-Ref
Test that get_action_events_by_course returns events between the
provided timesort values.


test_get_action_events_by_course_between_time_after_event()   X-Ref
Test that get_action_events_by_course returns events between the
provided timesort values and after the last seen event when one is
provided.


test_get_action_events_by_course_between_time_skip_even_records()   X-Ref
Test that get_action_events_by_course returns events between the
provided timesort values and the last seen event can be provided to
get paginated results.


test_get_action_events_by_course_between_time_skip_first_records()   X-Ref
Test that get_action_events_by_course returns events between the
provided timesort values. The database will continue to be read until the
number of events requested has been satisfied. In this case the first
five events are rejected so it should require two database requests.


test_get_action_events_by_course_non_consecutive_ids()   X-Ref
Test that get_action_events_by_course returns events between the
provided timesort values and after the last seen event when one is
provided. This should work even when the event ids aren't ordered the
same as the timesort order.


test_get_action_events_by_course_with_identical_group_override_priorities()   X-Ref
There are subtle cases where the priority of an event override may be identical to another.
For example, if you duplicate a group override, but make it apply to a different group. Now
there are two overrides with exactly the same overridden dates. In this case the priority of
both is 1.

In this situation:
- A user in group A should see only the A override
- A user in group B should see only the B override
- A user in both A and B should see both