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.

Class: container_test  - X-Ref

Event container test..

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_with_completed_module_related_event()   X-Ref
Checks that completed activities events do not show.


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