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 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

mod_h5pactivity generator tests

Copyright: 2020 Ferran Recio <ferran@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 368 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: mod_h5pactivity_generator_testcase  - X-Ref

Genarator tests class for mod_h5pactivity.

test_create_instance()   X-Ref
Test on H5P activity creation.


test_create_file_exception()   X-Ref
Test that a new H5P activity cannot be generated without a valid file
other user.


test_create_attempt(array $tracks, int $attempts, int $results, bool $exception)   X-Ref
Test to create H5P attempts

param: array $tracks the attempt tracks objects
param: int $attempts the final registered attempts
param: int $results the final registered attempts results
param: bool $exception if an exception is expected

create_attempt_data()   X-Ref
Data provider for create attempt test.

return: array

assert_attempt_matches_info($attemptinfo)   X-Ref
Insert track into attempt, creating the attempt if necessary.

param: array $attemptinfo the attempt track information

test_create_attempt_exceptions(bool $validmod, bool $validuser)   X-Ref
Test exceptions when creating an invalid attempt.

param: bool $validmod if the activity id is provided
param: bool $validuser if the user id is provided

create_attempt_exceptions_data()   X-Ref
Data provider for data request creation tests.

return: array