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.

Class: permission_test  - X-Ref

Unit tests for the report permission class

test_require_can_view_reports_list()   X-Ref
Test whether user can view reports list


test_require_can_view_reports_list_disabled()   X-Ref
Test whether user can view reports list when custom reports are disabled


test_require_can_view_report()   X-Ref
Test whether user can view specific report


test_require_can_view_report_with_audience()   X-Ref
Test whether user can view specific report when it belongs to an audience


test_require_can_view_report_disabled()   X-Ref
Test whether user can view report when custom reports are disabled


test_require_can_edit_report_system_report()   X-Ref
Test that user cannot edit system reports


test_require_can_edit_report_none()   X-Ref
Test that user cannot edit any reports without capabilities


test_require_can_edit_report_own()   X-Ref
Test that user can edit their own reports


test_require_can_edit_report_all()   X-Ref
Test that user can edit any reports


test_require_can_edit_report_disabled()   X-Ref
Test whether user can edit report when custom reports are disabled


test_require_can_create_report()   X-Ref
Test that user can create a new report


test_require_can_create_report_disabled()   X-Ref
Test whether user can create report when custom reports are disabled


can_create_report_limit_reached_provider()   X-Ref
Data provider for {@see test_can_create_report_limit_reached}

return: array

test_can_create_report_limit_reached(int $customreportslimit, int $existingreports, bool $expected)   X-Ref
Test whether user can create report when limit report are reache

param: int $customreportslimit
param: int $existingreports
param: bool $expected