forked from WordPress/WordPress-Coding-Standards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayDeclarationSpacingUnitTest.php
More file actions
96 lines (88 loc) · 1.91 KB
/
Copy pathArrayDeclarationSpacingUnitTest.php
File metadata and controls
96 lines (88 loc) · 1.91 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
<?php
/**
* Unit test class for WordPress Coding Standard.
*
* @package WPCS\WordPressCodingStandards
* @link https://github.com/WordPress/WordPress-Coding-Standards
* @license https://opensource.org/licenses/MIT MIT
*/
namespace WordPressCS\WordPress\Tests\Arrays;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
/**
* Unit test class for the ArrayDeclarationSpacing sniff.
*
* @since 0.11.0
* @since 0.13.0 Class name changed: this class is now namespaced.
*
* @covers \WordPressCS\WordPress\Sniffs\Arrays\ArrayDeclarationSpacingSniff
*/
final class ArrayDeclarationSpacingUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @param string $testFile The name of the file being tested.
*
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList( $testFile = '' ) {
switch ( $testFile ) {
// Long arrays.
case 'ArrayDeclarationSpacingUnitTest.1.inc':
return array(
9 => 4,
13 => 2,
15 => 1,
19 => 1,
22 => 1,
25 => 1,
44 => 1,
45 => 1,
48 => 1,
49 => 1,
52 => 2,
54 => 1,
57 => 1,
58 => 1,
62 => 1,
63 => 1,
75 => 1,
87 => 1,
88 => 1,
);
// Short arrays.
case 'ArrayDeclarationSpacingUnitTest.2.inc':
return array(
9 => 4,
13 => 2,
15 => 1,
19 => 1,
22 => 1,
25 => 1,
44 => 1,
45 => 1,
48 => 1,
49 => 1,
52 => 2,
54 => 1,
57 => 1,
58 => 1,
62 => 1,
63 => 1,
75 => 1,
97 => 1,
113 => 1,
114 => 1,
);
default:
return array();
}
}
/**
* Returns the lines where warnings should occur.
*
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList() {
return array();
}
}