Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

The capability manager tests.

Copyright: 2019 Ryan Wyllie <ryan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1331 lines (54 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 mod/forum/tests/generator_trait.php

Defines 1 class


Class: mod_forum_managers_capability_testcase  - X-Ref

The capability manager tests.

setUp()   X-Ref
Setup function before each test.


tearDown()   X-Ref
Tear down function after each test.


create_forum(array $forumproperties = [])   X-Ref
Helper function to create a forum entity.

param: array $forumproperties List of properties to override the prebuilt forum
return: forum

give_capability($capability, $context = null)   X-Ref
Helper function to assign a capability to the prebuilt role (teacher).

param: string $capability Name of the capability
param: context|null $context The context to assign the capability in

prevent_capability($capability, $context = null)   X-Ref
Helper function to prevent a capability to the prebuilt role (teacher).

param: string $capability Name of the capability
param: context|null $context The context to assign the capability in

test_can_subscribe_to_forum()   X-Ref
Test can_subscribe_to_forum.


test_can_create_discussions()   X-Ref
Test can_create_discussions.


test_can_access_all_groups()   X-Ref
Test can_access_all_groups.


test_can_access_group()   X-Ref
Test can_access_group.


test_can_view_discussions()   X-Ref
Test can_view_discussions.


test_can_move_discussions()   X-Ref
Test can_move_discussions.


test_can_pin_discussions()   X-Ref
Test can_pin_discussions.


test_can_split_discussions()   X-Ref
Test can_split_discussions.


test_can_export_discussions()   X-Ref
Test can_export_discussions.


test_can_manually_control_post_read_status()   X-Ref
Test can_manually_control_post_read_status.


test_must_post_before_viewing_discussion()   X-Ref
Test must_post_before_viewing_discussion.


test_can_subscribe_to_discussion()   X-Ref
Test can_subscribe_to_discussion.


test_can_move_discussion()   X-Ref
Test can_move_discussion.


test_can_pin_discussion()   X-Ref
Test can_pin_discussion.


test_can_post_in_discussion()   X-Ref
Test can_post_in_discussion.


test_can_edit_post()   X-Ref
Test can_edit_post.


test_can_delete_post()   X-Ref
Test can_delete_post.


test_can_split_post()   X-Ref
Test can_split_post.


test_can_reply_to_post()   X-Ref
Test can_reply_to_post.


test_can_reply_to_post_in_qanda_forum()   X-Ref
Test for \mod_forum\local\managers\capability::can_reply_to_post() involving Q & A forums.


test_can_reply_privately_to_post()   X-Ref
Ensure that can_reply_privately_to_post works as expected.


test_can_view_post()   X-Ref
Ensure that can_view_post works as expected.


test_can_view_post_shell()   X-Ref
Ensure that can_view_post_shell considers private replies correctly.


test_can_export_post()   X-Ref
Test can_export_post.


test_can_view_participants()   X-Ref
Test can_view_participants.


test_can_view_hidden_posts()   X-Ref
Test can_view_hidden_posts.


test_can_manage_forum()   X-Ref
Test can_manage_forum.


test_can_manage_tags()   X-Ref
Test can_manage_tags.


test_can_view_any_private_reply()   X-Ref
Ensure that the can_view_any_private_reply works as expected.


test_validate_delete_post_with_ratings()   X-Ref
Test delete a post with ratings.


test_validate_delete_post_with_replies()   X-Ref
Test delete a post with replies.