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 module forums external functions unit tests

Copyright: 2012 Mark Nelson <markn@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 3478 lines (169 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

mod_forum_external_testcase:: (39 methods):
  setUp()
  tearDown()
  test_mod_forum_get_forums_by_courses()
  test_mod_forum_toggle_favourite_state()
  test_mod_forum_set_pin_state()
  test_mod_forum_get_forum_discussion_posts()
  test_mod_forum_get_discussion_posts()
  test_mod_forum_get_forum_discussion_posts_deleted()
  test_mod_forum_get_forum_discussion_posts_qanda()
  test_mod_forum_get_forum_discussions_paginated()
  test_mod_forum_get_forum_discussions_paginated_qanda()
  test_mod_forum_get_forum_discussions()
  test_mod_forum_get_forum_discussions_sorting()
  test_add_discussion_post()
  test_add_discussion_post_subscribe_discussion()
  test_add_discussion()
  test_add_discussion_in_course_with_groups()
  test_set_lock_state()
  test_can_add_discussion()
  test_can_add_discussion_after_cutoff()
  test_mod_forum_get_forum_discussion_rating_information()
  test_mod_forum_get_forum_access_information()
  test_add_discussion_post_private()
  test_trusted_text_enabled()
  test_trusted_text_disabled()
  test_delete_post_discussion()
  test_delete_post_post()
  test_delete_post_other_user_post()
  test_mod_forum_get_discussion_posts_by_userid()
  test_get_discussion_post_discussion()
  test_get_discussion_post_post()
  test_get_discussion_post_other_user_post()
  test_prepare_draft_area_for_post()
  test_update_discussion_post_discussion()
  test_update_discussion_post_post()
  test_update_discussion_post_other_user_post()
  test_update_discussion_post_set_subject_to_zero()
  test_update_discussion_post_set_message_to_zero()
  test_update_discussion_post_set_message_format_moodle()


Class: mod_forum_external_testcase  - X-Ref

setUp()   X-Ref
Tests set up


tearDown()   X-Ref
No description

test_mod_forum_get_forums_by_courses()   X-Ref
Test get forums


test_mod_forum_toggle_favourite_state()   X-Ref
Test the toggle favourite state


test_mod_forum_set_pin_state()   X-Ref
Test the toggle pin state


test_mod_forum_get_forum_discussion_posts()   X-Ref
Test get forum posts


test_mod_forum_get_discussion_posts()   X-Ref
Test get forum posts

Tests is similar to the get_forum_discussion_posts only utilizing the new return structure and entities

test_mod_forum_get_forum_discussion_posts_deleted()   X-Ref
Test get forum posts


test_mod_forum_get_forum_discussion_posts_qanda()   X-Ref
Test get forum posts (qanda forum)


test_mod_forum_get_forum_discussions_paginated()   X-Ref
Test get forum discussions paginated


test_mod_forum_get_forum_discussions_paginated_qanda()   X-Ref
Test get forum discussions paginated (qanda forums)


test_mod_forum_get_forum_discussions()   X-Ref
Test get forum discussions


test_mod_forum_get_forum_discussions_sorting()   X-Ref
Test the sorting in get forum discussions


test_add_discussion_post()   X-Ref
Test add_discussion_post


test_add_discussion_post_subscribe_discussion()   X-Ref
Test add_discussion_post and auto subscription to a discussion.


test_add_discussion()   X-Ref
No description

test_add_discussion_in_course_with_groups()   X-Ref
Test adding discussions in a course with gorups


test_set_lock_state()   X-Ref
No description

test_can_add_discussion()   X-Ref
No description

test_can_add_discussion_after_cutoff()   X-Ref
No description

test_mod_forum_get_forum_discussion_rating_information()   X-Ref
Test get forum posts discussions including rating information.


test_mod_forum_get_forum_access_information()   X-Ref
Test mod_forum_get_forum_access_information.


test_add_discussion_post_private()   X-Ref
Test add_discussion_post


test_trusted_text_enabled()   X-Ref
Test trusted text enabled.


test_trusted_text_disabled()   X-Ref
Test trusted text disabled.


test_delete_post_discussion()   X-Ref
Test delete a discussion.


test_delete_post_post()   X-Ref
Test delete a post.


test_delete_post_other_user_post()   X-Ref
Test delete a different user post.


test_mod_forum_get_discussion_posts_by_userid()   X-Ref
No description

test_get_discussion_post_discussion()   X-Ref
Test get_discussion_post a discussion.


test_get_discussion_post_post()   X-Ref
Test get_discussion_post a post.


test_get_discussion_post_other_user_post()   X-Ref
Test get_discussion_post a different user post.


test_prepare_draft_area_for_post()   X-Ref
Test prepare_draft_area_for_post a different user post.


test_update_discussion_post_discussion()   X-Ref
Test update_discussion_post with a discussion.


test_update_discussion_post_post()   X-Ref
Test update_discussion_post with a post.


test_update_discussion_post_other_user_post()   X-Ref
Test update_discussion_post with other user post (no permissions).


test_update_discussion_post_set_subject_to_zero()   X-Ref
Test that we can update the subject of a post to the string '0'


test_update_discussion_post_set_message_to_zero()   X-Ref
Test that we can update the message of a post to the string '0'


test_update_discussion_post_set_message_format_moodle()   X-Ref
Test that we can update the message format of a post to {@see FORMAT_MOODLE}