diff --git a/exemptions/classes/local/repository/exemption_repository.php b/exemptions/classes/local/repository/exemption_repository.php index 2f305740c2ac..c2529b78202d 100644 --- a/exemptions/classes/local/repository/exemption_repository.php +++ b/exemptions/classes/local/repository/exemption_repository.php @@ -230,7 +230,7 @@ public function find_by(array $criteria, int $limitfrom = 0, int $limitnum = 0): */ public function find_exemption(string $component, string $itemtype, int $itemid, int $contextid): exemption { global $DB; - // exemptions model: We know that only one exemption can exist based on these properties. + // Exemptions model: We know that only one exemption can exist based on these properties. $record = $DB->get_record($this->exemptiontable, [ 'component' => $component, 'itemtype' => $itemtype, diff --git a/exemptions/tests/component_exemption_service_test.php b/exemptions/tests/component_exemption_service_test.php index e8b32de87b98..73c8b795015b 100644 --- a/exemptions/tests/component_exemption_service_test.php +++ b/exemptions/tests/component_exemption_service_test.php @@ -200,6 +200,8 @@ protected function get_mock_repository(array $mockstore) { /** * Test confirming the deletion of exemptions by type and item, but with no optional context filter provided. + * + * @covers ::delete_exemptions_by_type_and_item */ public function test_delete_exemptions_by_type_and_item(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -243,6 +245,8 @@ public function test_delete_exemptions_by_type_and_item(): void { /** * Test confirming the deletion of exemptions by type and item and with the optional context filter provided. + * + * @covers ::delete_exemptions_by_type_and_item */ public function test_delete_exemptions_by_type_and_item_with_context(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -300,6 +304,8 @@ public function test_delete_exemptions_by_type_and_item_with_context(): void { /** * Test getting a component_exemption_service from the static locator. + * + * @covers ::get_service_for_component */ public function test_get_service_for_component(): void { $userservice = \core_exemptions\service_factory::get_service_for_component('core_course'); @@ -308,6 +314,8 @@ public function test_get_service_for_component(): void { /** * Test confirming an item can be exempt only once. + * + * @covers ::create_exemption */ public function test_create_exemption_basic(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -327,6 +335,8 @@ public function test_create_exemption_basic(): void { /** * Test confirming that an exception is thrown if trying to create an item for a non-existent component. + * + * @covers ::__construct */ public function test_create_exemption_nonexistent_component(): void { // Get a component_exemption_service for the user. @@ -339,6 +349,8 @@ public function test_create_exemption_nonexistent_component(): void { /** * Test fetching exemptions for single user, by area. + * + * @covers ::find_exemptions_by_type */ public function test_find_exemptions_by_type_single_user(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -365,6 +377,8 @@ public function test_find_exemptions_by_type_single_user(): void { /** * Test fetching exemptions for single user, by area. + * + * @covers ::find_all_exemptions */ public function test_find_all_exemptions(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -401,6 +415,8 @@ public function test_find_all_exemptions(): void { /** * Test confirming the pagination support for the find_exemptions_by_type() method. + * + * @covers ::find_exemptions_by_type */ public function test_find_exemptions_by_type_pagination(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -432,6 +448,8 @@ public function test_find_exemptions_by_type_pagination(): void { /** * Test confirming the basic deletion behaviour. + * + * @covers ::delete_exemption */ public function test_delete_exemption_basic(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -457,6 +475,8 @@ public function test_delete_exemption_basic(): void { /** * Test confirming the behaviour of the exemption_exists() method. + * + * @covers ::exemption_exists */ public function test_exemption_exists(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -489,6 +509,8 @@ public function test_exemption_exists(): void { /** * Test confirming the behaviour of the get_exemption() method. + * + * @covers ::get_exemption */ public function test_get_exemption(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -520,6 +542,8 @@ public function test_get_exemption(): void { /** * Test confirming the behaviour of the count_exemptions_by_type() method. + * + * @covers ::count_exemptions_by_type */ public function test_count_exemptions_by_type(): void { [$user1context, $user2context, $course1context, $course2context] = $this->setup_users_and_courses(); @@ -550,6 +574,8 @@ public function test_count_exemptions_by_type(): void { /** * Verify that the join sql generated by get_join_sql_by_type is valid and can be used to include exemption information. + * + * @covers ::get_join_sql_by_type */ public function test_get_join_sql_by_type(): void { global $DB;