MDL-82207 phpunit: fix various @covers annotations (take#1)

This fixes various (not all) wrong @covers annotations that
are reported as warnings by PHPUnit when it's run with
code-coverage enabled.

When possible, the preferred solution is to change to
@covers at class level, that is the recommended way.

If multiple classes are involved, then a mix of @coversDefaultClass
and @covers at method level are used (always trying to use the
minimum needed patch).

This is the first of a series of issues created as sub-tasks
of MDL-82142.
This commit is contained in:
Eloy Lafuente (stronk7) 2024-06-17 18:07:47 +02:00
parent ad7fc69c25
commit ad5fe71868
No known key found for this signature in database
GPG key ID: 53487A05E6228820
53 changed files with 75 additions and 128 deletions

View file

@ -280,9 +280,6 @@ class api_test extends \advanced_testcase {
/**
* Test the adding and removing of members from room.
*
* @covers ::add_members_to_room
* @covers ::remove_members_from_room
*/
public function test_adding_and_removing_of_room_membership(): void {
$course = $this->get_course();
@ -311,8 +308,6 @@ class api_test extends \advanced_testcase {
/**
* Test the update of room membership with the change user role.
*
* @covers ::update_room_membership
*/
public function test_update_room_membership_on_user_role_change(): void {
global $DB;
@ -340,8 +335,6 @@ class api_test extends \advanced_testcase {
/**
* Test sync_provider method for the sync of available provider.
*
* @covers ::sync_provider
*/
public function test_sync_provider(): void {
// Generate the data.
@ -358,8 +351,6 @@ class api_test extends \advanced_testcase {
/**
* Test the removal of all members from the room.
*
* @covers ::remove_all_members_from_room
*/
public function test_remove_all_members_from_room(): void {
$course = $this->get_course();
@ -382,8 +373,6 @@ class api_test extends \advanced_testcase {
/**
* Test the configuration of room changes as well as the membership with the change of provider.
*
* @covers ::configure_room_and_membership_by_provider
*/
public function test_configure_room_and_membership_by_provider(): void {
global $DB;

View file

@ -48,7 +48,9 @@ class processor_test extends \advanced_testcase {
*
* @covers ::create_instance
* @covers ::get_id
* @covers ::get_instance
* @covers ::get_context
* @covers ::get_context_id
* @covers ::get_provider
* @covers ::get_room_name
*/
public function test_create_instance(): void {