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]

External comment functions unit tests

Copyright: 2015 Juan Leyva <juan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 460 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_comment_externallib_testcase  - X-Ref

External comment functions unit tests

setUp()   X-Ref
Tests set up


setup_course_and_users_basic()   X-Ref
Helper used to set up a course, with a module, a teacher and two students.

return: array the array of records corresponding to the course, teacher, and students.

test_get_comments()   X-Ref
Test get_comments


test_add_comments_not_enabled_site_level()   X-Ref
Test add_comments not enabled site level


test_add_comments_not_enabled_module_level()   X-Ref
Test add_comments not enabled module level


test_add_comments_single()   X-Ref
Test add_comments


test_add_comments_multiple_contains_invalid()   X-Ref
Test add_comments when one of the comments contains invalid data and cannot be created.

This simply verifies that the entire operation fails.

test_add_comments_multiple_all_valid()   X-Ref
Test add_comments when one of the comments contains invalid data and cannot be created.

This simply verifies that the entire operation fails.

test_add_comments_invalid_area()   X-Ref
Test add_comments invalid area


test_delete_comments_invalid_comment_id()   X-Ref
Test delete_comment invalid comment.


test_delete_comments_own_user()   X-Ref
Test delete_comment own user.


test_delete_comment_other_student()   X-Ref
Test delete_comment other student.


test_delete_comments_as_teacher()   X-Ref
Test delete_comment as teacher.