forked from phpstan/phpstan-phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNoMissingSpaceInMethodAnnotationRuleTest.php
87 lines (80 loc) · 2.23 KB
/
NoMissingSpaceInMethodAnnotationRuleTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php declare(strict_types = 1);
namespace PHPStan\Rules\PHPUnit;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
/**
* @extends RuleTestCase<NoMissingSpaceInMethodAnnotationRule>
*/
final class NoMissingSpaceInMethodAnnotationRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
return new NoMissingSpaceInMethodAnnotationRule(new AnnotationHelper());
}
public function testRule(): void
{
$this->analyse([__DIR__ . '/data/InvalidMethodCoversAnnotation.php'], [
[
'Annotation "@backupGlobals" is invalid, "@backupGlobals" should be followed by a space and a value.',
12,
],
[
'Annotation "@backupStaticAttributes" is invalid, "@backupStaticAttributes" should be followed by a space and a value.',
19,
],
[
'Annotation "@covers\Dummy\Foo::assertSame" is invalid, "@covers" should be followed by a space and a value.',
27,
],
[
'Annotation "@covers::assertSame" is invalid, "@covers" should be followed by a space and a value.',
27,
],
[
'Annotation "@coversDefaultClass\Dummy\Foo" is invalid, "@coversDefaultClass" should be followed by a space and a value.',
33,
],
[
'Annotation "@dataProvider" is invalid, "@dataProvider" should be followed by a space and a value.',
39,
],
[
'Annotation "@depends" is invalid, "@depends" should be followed by a space and a value.',
45,
],
[
'Annotation "@preserveGlobalState" is invalid, "@preserveGlobalState" should be followed by a space and a value.',
52,
],
[
'Annotation "@requires" is invalid, "@requires" should be followed by a space and a value.',
58,
],
[
'Annotation "@testDox" is invalid, "@testDox" should be followed by a space and a value.',
64,
],
[
'Annotation "@testWith" is invalid, "@testWith" should be followed by a space and a value.',
70,
],
[
'Annotation "@ticket" is invalid, "@ticket" should be followed by a space and a value.',
76,
],
[
'Annotation "@uses" is invalid, "@uses" should be followed by a space and a value.',
82,
],
]);
}
/**
* @return string[]
*/
public static function getAdditionalConfigFiles(): array
{
return [
__DIR__ . '/../../../extension.neon',
];
}
}