Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

(no description)

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

Defines 1 class


Class: resource_link_repository_test  - X-Ref

Tests for resource_link_repository objects.

generate_resource_link($id = 'res-link-1')   X-Ref
Helper to generate a new resource_link instance.

return: resource_link the resource_link instance.
param: string $id the id to use for this the resource link.

assert_same_resourcelink_values(resource_link $expected, resource_link $check)   X-Ref
Helper to assert that all the key elements of two resource_links (i.e. excluding id) are equal.

param: resource_link $expected the resource_link whose values are deemed correct.
param: resource_link $check the resource_link to check.

assert_resourcelink_db_values(resource_link $expected)   X-Ref
Helper to assert that all the key elements of a resource_link are present in the DB.

param: resource_link $expected the resource_link whose values are deemed correct.

test_save_new()   X-Ref
Tests adding a resource_link to the store.


test_add_uniqueness_constraints()   X-Ref
Test that we cannot add two resource_links with the same resourcelinkid for a given deploymentid.


test_find()   X-Ref
Test fetching an object from the store.


test_find_by_resource()   X-Ref
Test finding a collection of resource links by resource.


test_find_by_resource_and_user()   X-Ref
Test finding a collection of resource links by resource and user.


test_delete()   X-Ref
Test deletion from the store.


test_delete_by_resource()   X-Ref
Test deleting a group of resource links by resource.


test_delete_by_deployment()   X-Ref
Test deleting a resource links by their deployment container.


test_exists()   X-Ref
Test checking existence in the store.


test_save_existing()   X-Ref
Test update of an existing resource_link.


test_update_stale()   X-Ref
Test update with a stale object which is no longer present in the store.