Differences Between: [Versions 310 and 311] [Versions 39 and 311]
This file contains helper classes and functions for testing.
Copyright: | 2017 Ryan Wyllie <ryan@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 256 lines (9 kb) |
Included or required: | 5 times |
Referenced: | 1 time |
Includes or requires: | 0 files |
action_event_test_factory:: (2 methods):
__construct()
create_instance()
Class: action_event_test_factory - X-Ref
A test factory that will create action events.__construct($callback = null) X-Ref |
A test factory that will create action events. The factory accepts a callback that will be used to determine if the event should be returned or not. The callback will be given the event and should return true if the event should be returned and false otherwise. param: callable $callback The callback. |
create_instance(\stdClass $record) X-Ref |
No description |
create_event($properties) X-Ref |
Create a calendar event with the given properties. param: array $properties The properties to set on the event return: \calendar_event |
create_standard_events(int $quantity) X-Ref |
Helper function to create a x number of events for each event type. param: int $quantity The quantity of events to be created. return: array List of created events. |
create_action_event(array $data) X-Ref |
Helper function to create an action event. param: array $data The event data. return: bool|calendar_event |
create_user_override_event(string $modulename, int $instanceid, int $userid) X-Ref |
Helper function to create an user override calendar event. param: string $modulename The modulename. param: int $instanceid The instance id. param: int $userid The user id. return: calendar_event|false |
create_group_override_event(string $modulename, int $instanceid, int $courseid, int $groupid) X-Ref |
Helper function to create an group override calendar event. param: string $modulename The modulename. param: int $instanceid The instance id. param: int $courseid The course id. param: int $groupid The group id. return: calendar_event|false |