Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

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

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

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