mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 03:46:42 +02:00
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:
parent
ad7fc69c25
commit
ad5fe71868
53 changed files with 75 additions and 128 deletions
|
@ -40,7 +40,6 @@ class base_test extends advanced_testcase {
|
|||
* Tests the save and load functionality.
|
||||
*
|
||||
* @author Jason den Dulk
|
||||
* @covers \core_courseformat
|
||||
*/
|
||||
public function test_courseformat_saveandload(): void {
|
||||
$this->resetAfterTest();
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace core_courseformat;
|
|||
* @package core_courseformat
|
||||
* @copyright 2023 Ferran Recio <ferran@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @coversDefaultClass \core_courseformat\base
|
||||
* @coversDefaultClass \core_courseformat\formatactions
|
||||
*/
|
||||
class formatactions_test extends \advanced_testcase {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ use cm_info;
|
|||
* @package core_courseformat
|
||||
* @copyright 2023 Ferran Recio <ferran@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @coversDefaultClass \core_courseformat\base
|
||||
* @coversDefaultClass \core_courseformat\local\baseactions
|
||||
*/
|
||||
class baseactions_test extends \advanced_testcase {
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,7 @@ use core_courseformat\hook\after_cm_name_edited;
|
|||
* @package core_courseformat
|
||||
* @copyright 2024 Ferran Recio <ferran@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @coversDefaultClass \core_courseformat\cmactions
|
||||
* @coversDefaultClass \core_courseformat\local\cmactions
|
||||
*/
|
||||
final class cmactions_test extends \advanced_testcase {
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,7 @@ use stdClass;
|
|||
* @package core_courseformat
|
||||
* @copyright 2023 Ferran Recio <ferran@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @coversDefaultClass \core_courseformat\sectionactions
|
||||
* @coversDefaultClass \core_courseformat\local\sectionactions
|
||||
*/
|
||||
class sectionactions_test extends \advanced_testcase {
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,9 @@ class state_test extends \advanced_testcase {
|
|||
* Test the behaviour of state::export_for_template().
|
||||
*
|
||||
* @dataProvider state_provider
|
||||
* @covers \core_courseformat\output\local\state
|
||||
* @covers \core_courseformat\output\local\state\course
|
||||
* @covers \core_courseformat\output\local\state\section
|
||||
* @covers \core_courseformat\output\local\state\cm
|
||||
*
|
||||
* @param string $format The course format of the course where the method will be executed.
|
||||
*/
|
||||
|
|
|
@ -575,7 +575,9 @@ class restore_test extends \advanced_testcase {
|
|||
* Tests course restore with editor in course format.
|
||||
*
|
||||
* @author Matthew Hilton
|
||||
* @covers \core_courseformat
|
||||
* @covers \core_courseformat\base
|
||||
* @covers \backup_course_structure_step
|
||||
* @covers \restore_course_structure_step
|
||||
*/
|
||||
public function test_restore_editor_courseformat(): void {
|
||||
$this->resetAfterTest();
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
* @subpackage course
|
||||
* @copyright 2021 Tomo Tsuyuki <tomotsuyuki@catalyst-au.net>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \core_course\task\course_delete_modules
|
||||
*/
|
||||
namespace core_course;
|
||||
|
||||
|
@ -68,8 +69,6 @@ class course_delete_modules_test extends \advanced_testcase {
|
|||
|
||||
/**
|
||||
* Test with failed and successful cms
|
||||
*
|
||||
* @covers ::course_delete_modules
|
||||
*/
|
||||
public function test_delete_module_exception(): void {
|
||||
global $DB;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue