-
-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathVariableCommentUnitTest.php
More file actions
116 lines (105 loc) · 3.15 KB
/
VariableCommentUnitTest.php
File metadata and controls
116 lines (105 loc) · 3.15 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/**
* Unit test class for the VariableComment sniff.
*
* @author Greg Sherwood <gsherwood@squiz.net>
* @copyright 2006-2023 Squiz Pty Ltd (ABN 77 084 670 600)
* @copyright 2023 PHPCSStandards and contributors
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
*/
namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;
/**
* Unit test class for the VariableComment sniff.
*
* @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\VariableCommentSniff
*/
final class VariableCommentUnitTest extends AbstractSniffTestCase
{
/**
* Returns the lines where errors should occur.
*
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
* @param string $testFile The name of the test file being tested.
*
* @return array<int, int>
*/
public function getErrorList($testFile = '')
{
switch ($testFile) {
case 'VariableCommentUnitTest.1.inc':
return [
21 => 1,
24 => 1,
56 => 1,
64 => 1,
73 => 1,
84 => 1,
130 => 1,
136 => 1,
144 => 1,
152 => 1,
160 => 1,
168 => 1,
176 => 1,
184 => 1,
192 => 1,
200 => 1,
208 => 1,
216 => 1,
224 => 1,
232 => 1,
240 => 1,
248 => 1,
256 => 1,
264 => 1,
272 => 1,
280 => 1,
290 => 1,
294 => 1,
311 => 1,
336 => 1,
361 => 1,
364 => 1,
399 => 1,
403 => 1,
457 => 1,
];
case 'VariableCommentUnitTest.2.inc':
return [
8 => 1,
18 => 1,
38 => 1,
48 => 1,
];
default:
return [];
}
}
/**
* Returns the lines where warnings should occur.
*
* The key of the array should represent the line number and the value
* should represent the number of warnings that should occur on that line.
*
* @param string $testFile The name of the test file being tested.
*
* @return array<int, int>
*/
public function getWarningList($testFile = '')
{
switch ($testFile) {
case 'VariableCommentUnitTest.1.inc':
return [
93 => 1,
494 => 1,
495 => 1,
496 => 1,
];
default:
return [];
}
}
}