Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

(no description)

File Size: 3400 lines (165 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

externallib_test:: (40 methods):
  setUp()
  tearDown()
  get_expected_attachment()
  test_mod_forum_get_forums_by_courses()
  test_mod_forum_toggle_favourite_state()
  test_mod_forum_set_pin_state()
  test_mod_forum_get_discussion_posts()
  test_mod_forum_get_discussion_posts_deleted()
  test_mod_forum_get_discussion_posts_inline_attachments()
  test_mod_forum_get_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_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: externallib_test  - X-Ref

The module forums external functions unit tests

setUp()   X-Ref
Tests set up


tearDown()   X-Ref
No description

get_expected_attachment(\stored_file $file, array $values = [], ?\moodle_url $url = null)   X-Ref
Get the expected attachment.

return: array
param: stored_file $file
param: array $values
param: moodle_url|null $url

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_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_discussion_posts_deleted()   X-Ref
Test get forum posts


test_mod_forum_get_discussion_posts_inline_attachments()   X-Ref
Test get forum posts returns inline attachments.


test_mod_forum_get_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_discussion_rating_information()   X-Ref
Test get 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}