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.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

SCORM module library functions tests

Copyright: 2015 Juan Leyva <juan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 908 lines (36 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: lib_test  - X-Ref

SCORM module library functions tests

setUp()   X-Ref
Set up for every test


test_scorm_check_mode()   X-Ref
No description

test_scorm_view()   X-Ref
Test scorm_view

return: void

test_scorm_check_and_require_available()   X-Ref
Test scorm_get_availability_status and scorm_require_available

return: void

test_scorm_get_last_completed_attempt()   X-Ref
Test scorm_get_last_completed_attempt

return: void

test_scorm_core_calendar_provide_event_action_open()   X-Ref
No description

test_scorm_core_calendar_provide_event_action_closed()   X-Ref
No description

test_scorm_core_calendar_provide_event_action_open_in_future()   X-Ref
No description

test_scorm_core_calendar_provide_event_action_with_different_user_as_admin()   X-Ref
No description

test_scorm_core_calendar_provide_event_action_no_time_specified()   X-Ref
No description

test_scorm_core_calendar_provide_event_action_already_completed()   X-Ref
No description

test_scorm_core_calendar_provide_event_action_already_completed_for_user()   X-Ref
No description

create_action_event($courseid, $instanceid, $eventtype, $timestart = null)   X-Ref
Creates an action event.

param: int $courseid
param: int $instanceid The data id.
param: string $eventtype The event type. eg. DATA_EVENT_TYPE_OPEN.
param: int|null $timestart The start timestamp for the event
return: bool|calendar_event

test_mod_scorm_completion_get_active_rule_descriptions()   X-Ref
Test the callback responsible for returning the completion rule descriptions.
This function should work given either an instance of the module (cm_info), such as when checking the active rules,
or if passed a stdClass of similar structure, such as when checking the the default completion settings for a mod type.


test_mod_scorm_core_calendar_event_timestart_updated_unknown_event()   X-Ref
An unkown event type should not change the scorm instance.


test_mod_scorm_core_calendar_event_timestart_updated_open_event()   X-Ref
A SCORM_EVENT_TYPE_OPEN event should update the timeopen property of
the scorm activity.


test_mod_scorm_core_calendar_event_timestart_updated_close_event()   X-Ref
A SCORM_EVENT_TYPE_CLOSE event should update the timeclose property of
the scorm activity.


test_mod_scorm_core_calendar_get_valid_event_timestart_range_unknown_event()   X-Ref
An unkown event type should not have any limits


test_mod_scorm_core_calendar_get_valid_event_timestart_range_open_event()   X-Ref
The open event should be limited by the scorm's timeclose property, if it's set.


test_mod_scorm_core_calendar_get_valid_event_timestart_range_close_event()   X-Ref
The close event should be limited by the scorm's timeopen property, if it's set.


test_creation_with_no_calendar_capabilities()   X-Ref
A user who does not have capabilities to add events to the calendar should be able to create a SCORM.