Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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.