Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

(no description)

File Size: 480 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: helper_test  - X-Ref

Test class covering the H5P helper.

setUp()   X-Ref
Register the H5P autoloader


test_display_options(bool $frame, bool $export, bool $embed, bool $copyright, int $expected)   X-Ref
Test the behaviour of get_display_options().

param: bool   $frame     Whether the frame should be displayed or not
param: bool   $export    Whether the export action button should be displayed or not
param: bool   $embed     Whether the embed action button should be displayed or not
param: bool   $copyright Whether the copyright action button should be displayed or not
param: int    $expected The expectation with the displayoptions value

display_options_provider()   X-Ref
Data provider for test_get_display_options().

return: array

test_save_h5p_missing_libraries()   X-Ref
Test the behaviour of save_h5p() when there are some missing libraries in the system.


test_save_h5p_existing_libraries()   X-Ref
Test the behaviour of save_h5p() when the libraries exist in the system.


test_save_h5p_metadata()   X-Ref
Test the behaviour of save_h5p() when the H5P file contains metadata.


test_save_h5p_invalid_file()   X-Ref
Test the behaviour of save_h5p() when the .h5p file is invalid.


test_can_deploy_package()   X-Ref
Test the behaviour of can_deploy_package().


test_can_update_library()   X-Ref
Test the behaviour of can_update_library().


test_get_messages()   X-Ref
Test the behaviour of get_messages().


test_get_export_info()   X-Ref
Test the behaviour of get_export_info().


test_parse_js_array(string $content, array $expected)   X-Ref
Test the parse_js_array function with a range of content.

param: string $content
param: array $expected

parse_js_array_provider()   X-Ref
Data provider for test_parse_js_array().

return: array