From adb4a5aade26028dd9407c7ac6ffce34a9eb8d81 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 10 Jun 2024 13:06:33 +0200 Subject: [PATCH] MDL-82148 phpunit: Remove all cases of multiple @coversDefaultClass Only one by class is allowed (to be used as shortcut exclusively) --- lib/tests/http_client_test.php | 6 +----- mod/quiz/tests/quiz_question_restore_test.php | 17 +++++++---------- privacy/tests/legacy_polyfill_test.php | 1 - .../update_question_version_status_test.php | 6 +++--- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/lib/tests/http_client_test.php b/lib/tests/http_client_test.php index 765dfa7455f..0a3884ffe6d 100644 --- a/lib/tests/http_client_test.php +++ b/lib/tests/http_client_test.php @@ -29,12 +29,8 @@ use GuzzleHttp\Psr7\Uri; * @category test * @copyright 2022 Safat Shahin * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * * @coversDefaultClass \core\http_client - * @coversDefaultClass \core\local\guzzle\redirect_middleware - * @coversDefaultClass \core\local\guzzle\check_request - * @coversDefaultClass \core\local\guzzle\cache_item - * @coversDefaultClass \core\local\guzzle\cache_handler - * @coversDefaultClass \core\local\guzzle\cache_storage */ class http_client_test extends \advanced_testcase { diff --git a/mod/quiz/tests/quiz_question_restore_test.php b/mod/quiz/tests/quiz_question_restore_test.php index 0dfbc0b1ee5..ba4f24933fa 100644 --- a/mod/quiz/tests/quiz_question_restore_test.php +++ b/mod/quiz/tests/quiz_question_restore_test.php @@ -34,9 +34,6 @@ require_once($CFG->dirroot . '/mod/quiz/locallib.php'); * @copyright 2021 Catalyst IT Australia Pty Ltd * @author Safat Shahin * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @coversDefaultClass \mod_quiz\question\bank\qbank_helper - * @coversDefaultClass \backup_quiz_activity_structure_step - * @coversDefaultClass \restore_quiz_activity_structure_step */ class quiz_question_restore_test extends \advanced_testcase { use \quiz_question_helper_test_trait; @@ -61,7 +58,7 @@ class quiz_question_restore_test extends \advanced_testcase { /** * Test a quiz backup and restore in a different course without attempts for course question bank. * - * @covers ::get_question_structure + * @covers \mod_quiz\question\bank\qbank_helper::get_question_structure */ public function test_quiz_restore_in_a_different_course_using_course_question_bank(): void { $this->resetAfterTest(); @@ -100,7 +97,7 @@ class quiz_question_restore_test extends \advanced_testcase { /** * Test a quiz backup and restore in a different course without attempts for quiz question bank. * - * @covers ::get_question_structure + * @covers \mod_quiz\question\bank\qbank_helper::get_question_structure */ public function test_quiz_restore_in_a_different_course_using_quiz_question_bank(): void { $this->resetAfterTest(); @@ -200,7 +197,7 @@ class quiz_question_restore_test extends \advanced_testcase { /** * Test quiz restore with attempts. * - * @covers ::get_question_structure + * @covers \mod_quiz\question\bank\qbank_helper::get_question_structure */ public function test_quiz_restore_with_attempts(): void { $this->resetAfterTest(); @@ -241,7 +238,7 @@ class quiz_question_restore_test extends \advanced_testcase { * * Also, for efficiency, tests restore of the review options. * - * @covers ::process_quiz_question_legacy_instance + * @covers \restore_quiz_activity_structure_step::process_quiz_question_legacy_instance */ public function test_pre_4_quiz_restore_for_regular_questions(): void { global $USER, $DB; @@ -289,7 +286,7 @@ class quiz_question_restore_test extends \advanced_testcase { /** * Test pre 4.0 quiz restore for random questions. * - * @covers ::process_quiz_question_legacy_instance + * @covers \restore_quiz_activity_structure_step::process_quiz_question_legacy_instance */ public function test_pre_4_quiz_restore_for_random_questions(): void { global $USER, $DB; @@ -337,7 +334,7 @@ class quiz_question_restore_test extends \advanced_testcase { /** * Test pre 4.0 quiz restore for random question tags. * - * @covers ::process_quiz_question_legacy_instance + * @covers \restore_quiz_activity_structure_step::process_quiz_question_legacy_instance */ public function test_pre_4_quiz_restore_for_random_question_tags(): void { global $USER, $DB; @@ -394,7 +391,7 @@ class quiz_question_restore_test extends \advanced_testcase { /** * Test pre 4.0 quiz restore for random question used on multiple quizzes. * - * @covers ::process_quiz_question_legacy_instance + * @covers \restore_quiz_activity_structure_step::process_quiz_question_legacy_instance */ public function test_pre_4_quiz_restore_shared_random_question(): void { global $USER, $DB; diff --git a/privacy/tests/legacy_polyfill_test.php b/privacy/tests/legacy_polyfill_test.php index c238559e0ed..75cd66feb42 100644 --- a/privacy/tests/legacy_polyfill_test.php +++ b/privacy/tests/legacy_polyfill_test.php @@ -21,7 +21,6 @@ * @category test * @copyright 2018 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @coversDefaultClass \core_privacy\local\legacy_polyfill */ namespace core_privacy; diff --git a/question/bank/editquestion/tests/external/update_question_version_status_test.php b/question/bank/editquestion/tests/external/update_question_version_status_test.php index 6b4e4a6de06..2e2857de475 100644 --- a/question/bank/editquestion/tests/external/update_question_version_status_test.php +++ b/question/bank/editquestion/tests/external/update_question_version_status_test.php @@ -26,9 +26,9 @@ use qbank_editquestion\external\update_question_version_status; * @copyright 2021 Catalyst IT Australia Pty Ltd * @author Safat Shahin * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @coversDefaultClass \core_question\local\bank\question_version_status + * + * @covers \core_question\local\bank\question_version_status * @coversDefaultClass \qbank_editquestion\external\update_question_version_status - * @coversDefaultClass \qbank_editquestion\editquestion_helper */ class update_question_version_status_test extends \advanced_testcase { @@ -53,7 +53,7 @@ class update_question_version_status_test extends \advanced_testcase { * Test if the submit status webservice changes the status of the question. * * @covers ::execute - * @covers ::get_question_status_string + * @covers \qbank_editquestion\editquestion_helper::get_question_status_string */ public function test_submit_status_updates_the_question_status(): void { global $DB;