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.

Class: core_calendar_container_testcase  - X-Ref

Core container testcase.

setUp()   X-Ref
Test setup.


test_get_event_factory()   X-Ref
Test getting the event factory.


test_event_factory_create_instance($dbrow)   X-Ref
Test that the event factory correctly creates instances of events.

param: \stdClass $dbrow Row from the "database".

test_event_factory_when_module_visibility_is_toggled_as_admin($dbrow)   X-Ref
Test that the event factory deals with invisible modules properly as admin.

param: \stdClass $dbrow Row from the "database".

test_event_factory_when_module_visibility_is_toggled_as_guest($dbrow)   X-Ref
Test that the event factory deals with invisible modules properly as a guest.

param: \stdClass $dbrow Row from the "database".

test_event_factory_when_course_visibility_is_toggled_as_admin($dbrow)   X-Ref
Test that the event factory deals with invisible courses as an admin.

param: \stdClass $dbrow Row from the "database".

test_event_factory_when_course_visibility_is_toggled_as_student($dbrow)   X-Ref
Test that the event factory deals with invisible courses as a student.

param: \stdClass $dbrow Row from the "database".

test_event_factory_when_category_visibility_is_toggled_as_admin()   X-Ref
Test that the event factory deals with invisible categorys as an admin.


test_event_factory_when_category_visibility_is_toggled_as_user()   X-Ref
Test that the event factory deals with invisible categorys as an user.


test_event_factory_when_category_visibility_is_toggled_as_guest()   X-Ref
Test that the event factory deals with invisible categorys as an guest.


test_event_factory_with_completion_related_event()   X-Ref
Test that the event factory deals with completion related events properly.


test_event_factory_unenrolled_user()   X-Ref
Test that the event factory only returns an event if the logged in user
is enrolled in the course.


test_delete_module_delete_events()   X-Ref
Test that when course module is deleted all events are also deleted.


test_get_event_mapper()   X-Ref
Test getting the event mapper.


get_event_factory_testcases()   X-Ref
Test cases for the get event factory test.


create_event($properties = [])   X-Ref
Helper function to create calendar events using the old code.

param: array $properties A list of calendar event properties to set
return: calendar_event|bool

get_dbrow_from_skeleton($skeleton)   X-Ref
Pad out a basic DB row with basic information.

param: \stdClass   $skeleton the current skeleton
return: \stdClass