Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 and 403]

(no description)

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

Defines 1 class


Class: cm_test  - X-Ref

Tests for cm state class.

setupBeforeClass()   X-Ref
Setup to ensure that fixtures are loaded.


test_cm_hasrestrictions_state(string $format = 'topics',string $rolename = 'editingteacher',bool $hasavailability = false,bool $available = false,bool $expected = false)   X-Ref
Test the behaviour of state\cm hasavailability attribute.

param: string $format the course format
param: string $rolename the user role name (editingteacher or student)
param: bool $hasavailability if the activity|section has availability
param: bool $available if the activity availability condition is available or not to the user
param: bool $expected the expected result

setup_hasrestrictions_scenario(string $format = 'topics',string $rolename = 'editingteacher',bool $hasavailability = false,bool $available = false)   X-Ref
Setup section or cm has restrictions scenario.

return: stdClass the scenario instances.
param: string $format the course format
param: string $rolename the user role name (editingteacher or student)
param: bool $hasavailability if the activity|section has availability
param: bool $available if the activity availability condition is available or not to the user

hasrestrictions_state_provider()   X-Ref
Data provider for test_state().

return: array