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.

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

Testing the H5P API.

Copyright: 2020 Sara Arjona <sara@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 506 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: api_testcase  - X-Ref

Test class covering the H5P API.

test_delete_library(string $libraryname, int $expectedh5p, int $expectedlibraries,int $expectedcontents, int $expecteddependencies)   X-Ref
Test the behaviour of delete_library().

param: string $libraryname          Machine name of the library to delete.
param: int    $expectedh5p          Total of H5P contents expected after deleting the library.
param: int    $expectedlibraries    Total of H5P libraries expected after deleting the library.
param: int    $expectedcontents     Total of H5P content_libraries expected after deleting the library.
param: int    $expecteddependencies Total of H5P library dependencies expected after deleting the library.

delete_library_provider()   X-Ref
Data provider for test_delete_library().

return: array

test_get_dependent_libraries(string $libraryname, int $expectedvalue)   X-Ref
Test the behaviour of get_dependent_libraries().

param: string $libraryname     Machine name of the library to delete.
param: int    $expectedvalue   Total of H5P required libraries expected.

get_dependent_libraries_provider()   X-Ref
Data provider for test_get_dependent_libraries().

return: array

test_get_library(string $libraryname, bool $emptyexpected)   X-Ref
Test the behaviour of get_library().

param: string $libraryname     Machine name of the library to delete.
param: bool   $emptyexpected   Wether the expected result is empty or not.

get_library_provider()   X-Ref
Data provider for test_get_library().

return: array

test_get_content_from_pluginfile_url()   X-Ref
Test the behaviour of get_content_from_pluginfile_url().


test_create_content_from_pluginfile_url()   X-Ref
Test the behaviour of create_content_from_pluginfile_url().


test_delete_content_from_pluginfile_url()   X-Ref
Test the behaviour of delete_content_from_pluginfile_url().


test_get_export_info_from_context_id()   X-Ref
Test the behaviour of get_export_info_from_context_id().