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.

Differences Between: [Versions 310 and 401] [Versions 39 and 401] [Versions 401 and 403]

Contains the tests for the content_item_service class.

Copyright: 2020 Jake Dallimore <jrhdallimore@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 258 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: services_content_item_service_test  - X-Ref

The tests for the content_item_service class.

test_get_content_items_for_user_in_course_basic()   X-Ref
Test confirming that content items are returned by the service.


test_get_content_items_for_user_in_course_permissions()   X-Ref
Test confirming that access control is performed when asking the service to return content items for a user in a course.


test_get_content_item_for_user_in_course_link_params()   X-Ref
Test confirming that params can be added to the content item's link.


test_get_all_content_items()   X-Ref
Test confirming that all content items can be fetched irrespective of permissions.


test_get_content_items_by_name_pattern()   X-Ref
Test confirming that content items which title match a certain pattern can be fetched irrespective of permissions.


test_add_to_user_favourites()   X-Ref
Test confirming that a content item can be added to a user's favourites.


test_remove_from_user_favourites()   X-Ref
Test verifying that content items can be removed from a user's favourites.


test_toggle_recommendation()   X-Ref
Test that toggling a recommendation works as anticipated.