Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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.

Fixture for testing the functionality of core_h5p.

Copyright: 2019 Victor Deniz <victor@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 106 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

h5p_test_factory:: (1 method):
  get_core()

h5p_test_core:: (2 methods):
  set_endpoint()
  get_api_endpoint()


Class: h5p_test_factory  - X-Ref

H5P factory class stub for testing purposes.

This class extends the real one to return the H5P core class stub.

get_core()   X-Ref
Returns an instance of the \core_h5p\core stub class.

return: core_h5p\core

Class: h5p_test_core  - X-Ref

H5P core class stub for testing purposes.

Modifies get_api_endpoint method to use local URLs.

set_endpoint($url)   X-Ref
Set the endpoint URL

param: string $url Endpoint URL
return: void

get_api_endpoint(?string $library = null, string $endpoint = 'content')   X-Ref
Get the URL of the test endpoints instead of the H5P ones.

If $endpoint = 'content' and $library is null, moodle_url is the endpoint of the latest version of the H5P content
types; however, if $library is the machine name of a content type, moodle_url is the endpoint to download the content type.
The SITES endpoint ($endpoint = 'site') may be use to get a site UUID or send site data.

param: string|null $library The machineName of the library whose endpoint is requested.
param: string $endpoint The endpoint required. Valid values: "site", "content".
return: \moodle_url The endpoint moodle_url object.