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.

Differences Between: [Versions 310 and 311] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 639 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: repository_test  - X-Ref

Test class covering the favourite_repository.

setUp()   X-Ref
No description

setup_users_and_courses()   X-Ref
No description

test_add()   X-Ref
Verify the basic create operation can create records, and is validated.


test_add_malformed_favourite()   X-Ref
Tests that malformed favourites cannot be saved.


test_add_incomplete_favourite()   X-Ref
Tests that incomplete favourites cannot be saved.


test_add_all_basic()   X-Ref
No description

test_find()   X-Ref
Tests reading from the repository by instance id.


test_find_all()   X-Ref
Test verifying that find_all() returns all favourites, or an empty array.


test_find_all_pagination()   X-Ref
Testing the pagination of the find_all method.


test_find_by()   X-Ref
Test retrieval of a user's favourites for a given criteria, in this case, area.


test_find_by_pagination()   X-Ref
Testing the pagination of the find_by method.


test_count_by()   X-Ref
Test the count_by() method.


test_exists()   X-Ref
Test the exists() function.


test_exists_by()   X-Ref
Test the exists_by() method.


test_update()   X-Ref
Test the update() method, by simulating a user changing the ordering of a favourite.


test_delete()   X-Ref
No description

test_delete_by()   X-Ref
Test the delete_by() method.


test_find_favourite_basic()   X-Ref
Test the find_favourite() method for an existing favourite.


test_find_favourite_nonexistent_favourite()   X-Ref
Test confirming the repository throws an exception in find_favourite if the favourite can't be found.