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.

(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().