Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.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.