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 402] [Versions 401 and 403]

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