Skip to content

Commit 7d5bd27

Browse files
committed
WP/DeprecatedParameterValues: rename test case file
Doing this to allow for additional testcase files.
1 parent 9c414d1 commit 7d5bd27

File tree

2 files changed

+49
-33
lines changed

2 files changed

+49
-33
lines changed

WordPress/Tests/WP/DeprecatedParameterValuesUnitTest.inc renamed to WordPress/Tests/WP/DeprecatedParameterValuesUnitTest.1.inc

File renamed without changes.

WordPress/Tests/WP/DeprecatedParameterValuesUnitTest.php

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,47 +23,63 @@ final class DeprecatedParameterValuesUnitTest extends AbstractSniffUnitTest {
2323
/**
2424
* Returns the lines where errors should occur.
2525
*
26+
* @param string $testFile The name of the file being tested.
27+
*
2628
* @return array<int, int> Key is the line number, value is the number of expected errors.
2729
*/
28-
public function getErrorList() {
29-
return array(
30-
5 => 1,
31-
6 => 1,
32-
7 => 1,
33-
8 => 1,
34-
9 => 1,
35-
10 => 1,
36-
11 => 1,
37-
12 => 1,
38-
13 => 1,
39-
14 => 1,
40-
15 => 1,
41-
16 => 1,
42-
17 => 1,
43-
18 => 1,
44-
35 => 1,
45-
40 => 1,
46-
43 => 1,
47-
44 => 1,
48-
45 => 1,
49-
46 => 1,
50-
47 => 1,
51-
48 => 1,
52-
49 => 1,
53-
50 => 1,
54-
51 => 1,
55-
);
30+
public function getErrorList( $testFile = '' ) {
31+
switch ( $testFile ) {
32+
case 'DeprecatedParameterValuesUnitTest.1.inc':
33+
return array(
34+
5 => 1,
35+
6 => 1,
36+
7 => 1,
37+
8 => 1,
38+
9 => 1,
39+
10 => 1,
40+
11 => 1,
41+
12 => 1,
42+
13 => 1,
43+
14 => 1,
44+
15 => 1,
45+
16 => 1,
46+
17 => 1,
47+
18 => 1,
48+
35 => 1,
49+
40 => 1,
50+
43 => 1,
51+
44 => 1,
52+
45 => 1,
53+
46 => 1,
54+
47 => 1,
55+
48 => 1,
56+
49 => 1,
57+
50 => 1,
58+
51 => 1,
59+
);
60+
61+
default:
62+
return array();
63+
}
5664
}
5765

5866
/**
5967
* Returns the lines where warnings should occur.
6068
*
69+
* @param string $testFile The name of the file being tested.
70+
*
6171
* @return array<int, int> Key is the line number, value is the number of expected warnings.
6272
*/
63-
public function getWarningList() {
64-
return array(
65-
55 => 1,
66-
56 => 1,
67-
);
73+
public function getWarningList( $testFile = '' ) {
74+
switch ( $testFile ) {
75+
case 'DeprecatedParameterValuesUnitTest.1.inc':
76+
return array(
77+
55 => 1,
78+
56 => 1,
79+
);
80+
81+
default:
82+
return array();
83+
}
6884
}
6985
}

0 commit comments

Comments
 (0)