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: externallib_test  - 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.