File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ public function processCovers(
72
72
$ errors = [];
73
73
$ covers = (string ) $ phpDocTag ->value ;
74
74
$ isMethod = strpos ($ covers , ':: ' ) !== false ;
75
+ $ fullName = $ covers ;
75
76
76
77
if ($ isMethod ) {
77
78
[$ className , $ method ] = explode (':: ' , $ covers );
@@ -81,6 +82,7 @@ public function processCovers(
81
82
82
83
if ($ className === '' && $ node instanceof Node \Stmt \ClassMethod && $ coversDefaultClass !== null ) {
83
84
$ className = (string ) $ coversDefaultClass ->value ;
85
+ $ fullName = $ className . $ covers ;
84
86
}
85
87
86
88
if ($ this ->reflectionProvider ->hasClass ($ className )) {
@@ -89,7 +91,7 @@ public function processCovers(
89
91
if (isset ($ method ) && $ method !== '' && !$ class ->hasMethod ($ method )) {
90
92
$ errors [] = RuleErrorBuilder::message (sprintf (
91
93
'@covers value %s references an invalid method. ' ,
92
- $ covers
94
+ $ fullName
93
95
))->build ();
94
96
}
95
97
} else {
@@ -99,7 +101,7 @@ public function processCovers(
99
101
100
102
$ errors [] = RuleErrorBuilder::message (sprintf (
101
103
'@covers value %s references an invalid %s. ' ,
102
- $ covers ,
104
+ $ fullName ,
103
105
$ isMethod ? 'method ' : 'class or function '
104
106
))->build ();
105
107
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public function testRule(): void
26
26
{
27
27
$ this ->analyse ([__DIR__ . '/data/method-coverage.php ' ], [
28
28
[
29
- '@covers value ::ignoreThis references an invalid method. ' ,
29
+ '@covers value \Not\A\Class ::ignoreThis references an invalid method. ' ,
30
30
14 ,
31
31
],
32
32
[
@@ -42,7 +42,7 @@ public function testRule(): void
42
42
50 ,
43
43
],
44
44
[
45
- '@covers value ::assertNotReal references an invalid method. ' ,
45
+ '@covers value \PHPUnit\Framework\TestCase ::assertNotReal references an invalid method. ' ,
46
46
62 ,
47
47
],
48
48
[
You can’t perform that action at this time.
0 commit comments