Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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: mod_lti_external_testcase  - X-Ref

External tool module external functions tests

setUp()   X-Ref
Set up for every test


setup_test_data()   X-Ref
Sets up some basic test data including course, users, roles, and an lti instance, for use in some tests.

return: array

generate_tool_type(string $uniqueid, int $toolproxyid = null)   X-Ref
Generate a tool type.

param: string $uniqueid Each tool type needs a different base url. Provide a unique string for every tool type created.
param: int|null $toolproxyid Optional proxy to associate with tool type.
return: stdClass A tool type.

generate_tool_proxy(string $uniqueid)   X-Ref
Generate a tool proxy.

param: string $uniqueid Each tool proxy needs a different reg url. Provide a unique string for every tool proxy created.
return: stdClass A tool proxy.

test_mod_lti_get_tool_proxies()   X-Ref
Test get_tool_proxies.


test_mod_lti_get_orphaned_tool_proxies()   X-Ref
Test get_tool_proxies with orphaned proxies only.


test_get_tool_launch_data()   X-Ref
Test get_tool_launch_data.


test_mod_lti_get_ltis_by_courses()   X-Ref
Test get_ltis_by_courses.


test_view_lti_invalid_instanceid()   X-Ref
Test view_lti with an invalid instance id.


test_view_lti_no_enrolment()   X-Ref
Test view_lti as a user who is not enrolled in the course.


test_view_lti_no_capability()   X-Ref
Test view_lti for a user without the mod/lti:view capability.


test_view_lti()   X-Ref
Test view_lti for a user with the mod/lti:view capability in the course.


test_mod_lti_create_tool_proxy()   X-Ref
Test create_tool_proxy.


test_mod_lti_create_tool_proxy_duplicateurl()   X-Ref
Test create_tool_proxy with a duplicate url.


test_mod_lti_create_tool_proxy_without_capability()   X-Ref
Test create_tool_proxy for a user without the required capability.


test_mod_lti_delete_tool_proxy()   X-Ref
Test delete_tool_proxy.


test_mod_lti_get_tool_proxy_registration_request()   X-Ref
Test get_tool_proxy_registration_request.


test_mod_lti_get_tool_types()   X-Ref
Test get_tool_types.


test_mod_lti_create_tool_type()   X-Ref
Test create_tool_type.


test_mod_lti_create_tool_type_nonexistant_file()   X-Ref
Test create_tool_type failure from non existent file.


test_mod_lti_create_tool_type_bad_file()   X-Ref
Test create_tool_type failure from xml that is not a cartridge.


test_mod_lti_create_tool_type_without_capability()   X-Ref
Test create_tool_type as a user without the required capability.


test_mod_lti_update_tool_type()   X-Ref
Test update_tool_type.


test_mod_lti_delete_tool_type()   X-Ref
Test delete_tool_type for a user with the required capability.


test_mod_lti_delete_tool_type_without_capability()   X-Ref
Test delete_tool_type for a user without the required capability.


test_mod_lti_is_cartridge()   X-Ref
Test is_cartridge.