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: 234 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: context_repository_test  - X-Ref

Tests for context_repository.

create_test_context()   X-Ref
Helper to create test context objects for use with the repository tests.

return: context the context.

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

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

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

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

test_save_new()   X-Ref
Test saving a new context.


test_save_existing()   X-Ref
Test saving an existing context.


test_save_unique_constraints_not_met()   X-Ref
Test trying to save two contexts with the same id for the same deployment.


test_exists()   X-Ref
Test existence of a context within the repository.


test_find()   X-Ref
Test finding a context in the repository.


test_find_by_contextid()   X-Ref
Test finding a context by contextid within the deployment.


test_delete()   X-Ref
Test deleting a context from the repository.


test_delete_by_deployment()   X-Ref
Test deleting a context from the repository, by deployment.