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.

Class: private_replies_test  - X-Ref

Tests for private reply functionality.

setUp()   X-Ref
Setup before tests.


tearDown()   X-Ref
Tear down after tests.


test_forum_post_is_visible_privately_not_private()   X-Ref
Ensure that the forum_post_is_visible_privately function reports that a post is visible to a user when another
user wrote the post, and it is not private.


test_forum_post_is_visible_privately_private_to_user()   X-Ref
Ensure that the forum_post_is_visible_privately function reports that a post is visible to a user when another
user wrote the post, and the user under test is the intended recipient.


test_forum_post_is_visible_privately_private_to_user_view_as_teacher()   X-Ref
Ensure that the forum_post_is_visible_privately function reports that a post is visible to a user when another
user wrote the post, and the user under test is a role with the view capability.


test_forum_post_is_visible_privately_private_to_user_view_as_other_student()   X-Ref
Ensure that the forum_post_is_visible_privately function reports that a post is not visible to a user when
another user wrote the post, and the user under test is a role without the view capability.


test_forum_post_is_visible_privately_private_to_user_view_as_author()   X-Ref
Ensure that the forum_post_is_visible_privately function reports that a post is visible to a user who wrote a
private reply, but not longer holds the view capability.


test_forum_user_can_reply_privately_as_teacher()   X-Ref
Ensure that the forum_user_can_reply_privately returns true for a teacher replying to a forum post.


test_forum_user_can_reply_privately_as_student()   X-Ref
Ensure that the forum_user_can_reply_privately returns true for a teacher replying to a forum post.


test_forum_user_can_reply_privately_parent_is_already_private()   X-Ref
Ensure that the forum_user_can_reply_privately returns false where the parent post is already a private reply.