Skip to content

Commit

Permalink
MDL-82148 phpunit: Remove all cases of multiple @coversDefaultClass
Browse files Browse the repository at this point in the history
Only one by class is allowed (to be used as shortcut exclusively).
  • Loading branch information
stronk7 committed Jun 14, 2024
1 parent a585bda commit e812185
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
6 changes: 1 addition & 5 deletions lib/tests/http_client_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@
* @category test
* @copyright 2022 Safat Shahin <safat.shahin@moodle.com>
* @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 {

Expand Down
17 changes: 7 additions & 10 deletions mod/quiz/tests/quiz_question_restore_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
* @copyright 2021 Catalyst IT Australia Pty Ltd
* @author Safat Shahin <safatshahin@catalyst-au.net>
* @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;
Expand All @@ -61,7 +58,7 @@ public function setUp(): void {
/**
* 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() {
$this->resetAfterTest();
Expand Down Expand Up @@ -100,7 +97,7 @@ public function test_quiz_restore_in_a_different_course_using_course_question_ba
/**
* 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() {
$this->resetAfterTest();
Expand Down Expand Up @@ -200,7 +197,7 @@ public function test_quiz_duplicate_for_quiz_question_bank_questions() {
/**
* 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() {
$this->resetAfterTest();
Expand Down Expand Up @@ -241,7 +238,7 @@ public function test_quiz_restore_with_attempts() {
*
* 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() {
global $USER, $DB;
Expand Down Expand Up @@ -289,7 +286,7 @@ public function test_pre_4_quiz_restore_for_regular_questions() {
/**
* 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() {
global $USER, $DB;
Expand Down Expand Up @@ -337,7 +334,7 @@ public function test_pre_4_quiz_restore_for_random_questions() {
/**
* 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() {
global $USER, $DB;
Expand Down Expand Up @@ -394,7 +391,7 @@ public function test_pre_4_quiz_restore_for_random_question_tags() {
/**
* 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() {
global $USER, $DB;
Expand Down
1 change: 0 additions & 1 deletion privacy/tests/legacy_polyfill_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* @category test
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @coversDefaultClass \core_privacy\local\legacy_polyfill
*/

namespace core_privacy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
* @copyright 2021 Catalyst IT Australia Pty Ltd
* @author Safat Shahin <safatshahin@catalyst-au.net>
* @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 {

Expand All @@ -53,7 +53,7 @@ public function setUp(): void {
* 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() {
global $DB;
Expand Down

0 comments on commit e812185

Please sign in to comment.