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.

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

Testing the H5P helper.

Copyright: 2019 Sara Arjona <sara@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 427 lines (15 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.

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_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