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.

Class: generator_test  - X-Ref

Test class covering the h5p data generator class.

setUp()   X-Ref
Tests set up.


test_generate_h5p_data_no_files_created_return_data()   X-Ref
Test the returned data of generate_h5p_data() when the method is called without requesting
creation of library files.


test_generate_h5p_data_files_created_return_data()   X-Ref
Test the returned data of generate_h5p_data() when the method requests
creation of library files.


test_generate_h5p_data_files_creation(bool $createlibraryfiles, bool $expected)   X-Ref
Test the behaviour of generate_h5p_data(). Test whether library files are created or not
on filesystem depending what the method defines.

param: bool $createlibraryfiles Whether to create library files on the filesystem
param: bool $expected The expectation whether the files have been created or not

generate_h5p_data_files_creation_provider()   X-Ref
Data provider for test_generate_h5p_data_files_creation().

return: array

test_create_library_record()   X-Ref
Test the behaviour of create_library_record(). Test whether the library data is properly
saved in the database.


test_create_h5p_record(array $h5pdata, \stdClass $expected)   X-Ref
Test the behaviour of create_h5p_record(). Test whather the h5p content data is
properly saved in the database.

param: array $h5pdata The h5p content data
param: \stdClass $expected The expected saved data

create_h5p_record_provider()   X-Ref
Data provider for test_create_h5p_record().

return: array

test_create_contents_libraries_record(array $contentslibrariestdata, \stdClass $expected)   X-Ref
Test the behaviour of create_contents_libraries_record(). Test whether the contents libraries
are properly saved in the database.

param: array $contentslibrariestdata The h5p contents libraries data.
param: \stdClass $expected The expected saved data.

create_contents_libraries_record_provider()   X-Ref
Data provider for test_create_contents_libraries_record().

return: array

test_create_library_dependency_record(array $librarydependencydata, \stdClass $expected)   X-Ref
Test the behaviour of create_library_dependency_record(). Test whether the contents libraries
are properly saved in the database.

param: array $librarydependencydata The library dependency data.
param: \stdClass $expected The expected saved data.

create_library_dependency_record_provider()   X-Ref
Data provider for test_create_library_dependency_record().

return: array

test_create_content_file($filedata, $expecteddata)   X-Ref
Test the behaviour of create_content_file(). Test whether a file belonging to a content is created.

param: array $filedata Data from the file to be created.
param: array $expecteddata Data expected.Data from the file to be created.

create_content_file_provider()   X-Ref
Data provider for test_create_content_file(). Data from different files to be created.

return: array