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.

Class: generator_testcase  - X-Ref

Generator testcase for the core_grading generator.

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

test_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

test_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.

test_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.

test_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.

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

return: array