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]

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_testcase  - 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.