Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Testing the repository objects within core_favourites.

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

Defines 1 class


Class: favourite_repository_testcase  - 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.