10
10
namespace SebastianBergmann \CodeCoverage \Test \Target ;
11
11
12
12
use function array_keys ;
13
+ use function array_merge ;
13
14
use function range ;
14
15
use function realpath ;
15
16
use PHPUnit \Framework \Attributes \CoversClass ;
@@ -44,6 +45,29 @@ public static function provider(): array
44
45
],
45
46
),
46
47
],
48
+ [
49
+ 'single method ' ,
50
+ [
51
+ $ file => range (37 , 39 ),
52
+ ],
53
+ TargetCollection::fromArray (
54
+ [
55
+ Target::forMethod ('SebastianBergmann \\CodeCoverage \\StaticAnalysis \\ChildClass ' , 'six ' ),
56
+ ],
57
+ ),
58
+ ],
59
+ [
60
+ 'multiple methods ' ,
61
+ [
62
+ $ file => array_merge (range (37 , 39 ), range (41 , 43 )),
63
+ ],
64
+ TargetCollection::fromArray (
65
+ [
66
+ Target::forMethod ('SebastianBergmann \\CodeCoverage \\StaticAnalysis \\ChildClass ' , 'six ' ),
67
+ Target::forMethod ('SebastianBergmann \\CodeCoverage \\StaticAnalysis \\ChildClass ' , 'one ' ),
68
+ ],
69
+ ),
70
+ ],
47
71
];
48
72
}
49
73
@@ -55,10 +79,19 @@ public static function invalidProvider(): array
55
79
return [
56
80
[
57
81
'single class ' ,
58
- 'Class SebastianBergmann\CodeCoverage\StaticAnalysis\ChildClass is not a valid target for code coverage ' ,
82
+ 'Class DoesNotExist is not a valid target for code coverage ' ,
59
83
TargetCollection::fromArray (
60
84
[
61
- Target::forClass ('SebastianBergmann \\CodeCoverage \\StaticAnalysis \\ChildClass ' ),
85
+ Target::forClass ('DoesNotExist ' ),
86
+ ],
87
+ ),
88
+ ],
89
+ [
90
+ 'single method ' ,
91
+ 'Method DoesNotExist::doesNotExist is not a valid target for code coverage ' ,
92
+ TargetCollection::fromArray (
93
+ [
94
+ Target::forMethod ('DoesNotExist ' , 'doesNotExist ' ),
62
95
],
63
96
),
64
97
],
0 commit comments