Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

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

Defines 1 class

activity_custom_completion_test:: (6 methods):
  setup_mock()
  overall_completion_state_provider()
  test_get_overall_completion_state()
  validate_rule_provider()
  test_validate_rule()
  test_is_available()


Class: activity_custom_completion_test  - X-Ref

Class for unit testing core_completion/activity_custom_completion.

setup_mock(array $methods)   X-Ref
Fetches a mocked activity_custom_completion instance.

param: string[] $methods List of methods to mock.
return: activity_custom_completion|MockObject

overall_completion_state_provider()   X-Ref
Data provider for test_get_overall_completion_state().


test_get_overall_completion_state(array $rules, array $rulestates, int $invokecount, int $state)   X-Ref
Test for \core_completion\activity_custom_completion::get_overall_completion_state().

param: string[] $rules The custom completion rules.
param: int[] $rulestates The completion states of these custom completion rules.
param: int $invokecount Expected invoke count of get_state().
param: int $state The expected overall completion state

validate_rule_provider()   X-Ref
Data provider for test_validate_rule().

return: array[]

test_validate_rule(bool $defined, bool $available, ?string $expectedexception)   X-Ref
Test for validate_rule()

param: bool $defined is_defined()'s mocked return value.
param: bool $available is_available()'s mocked return value.
param: string|null $expectedexception Expected expectation class name.

test_is_available()   X-Ref
Test for is_available().