Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Class: event_vault_test  - 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