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.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

(no description)

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

Defines 1 class


Class: task_check_subscriptions_test  - X-Ref

Unit tests for the tool_monitor clean events task.

setUp()   X-Ref
Test set up.


reload_subscription()   X-Ref
Reloads the subscription object from the DB.

return: void.

test_task_name()   X-Ref
Test to confirm the task is named correctly.


test_site_level_subscription()   X-Ref
Test to confirm that site level subscriptions are activated and deactivated according to system capabilities.


test_module_disabled()   X-Ref
Test to confirm that if the module is disabled, no changes are made to active subscriptions.


test_active_unaffected()   X-Ref
Test to confirm an active, valid subscription stays active once the scheduled task is run.


test_course_enrolment()   X-Ref
Test to confirm that a subscription for a user without an enrolment to the course is made inactive.


test_enrolled_user_with_no_capability()   X-Ref
Test to confirm that subscriptions for enrolled users without the required capability are made inactive.


test_can_access_course()   X-Ref
Test to confirm that subscriptions for users who fail can_access_course(), are deactivated.


test_cm_access()   X-Ref
Test to confirm that subscriptions for enrolled users who don't have CM access, are deactivated.


test_stale_subscription_removal()   X-Ref
Test to confirm that long term inactive subscriptions are removed entirely.


test_user_not_fully_set_up()   X-Ref
Test to confirm that subscriptions for a partially set up user are deactivated.


test_suspended_user()   X-Ref
Test to confirm that a suspended user's subscriptions are deactivated properly.