Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

(no description)

File Size: 1351 lines (55 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 mod/forum/tests/generator_trait.php

Defines 1 class


Class: managers_capability_test  - 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.