Skip to content

Commit 60a85c9

Browse files
committed
Rename test case file to be able to add more test case files with syntax errors
1 parent 62532db commit 60a85c9

File tree

3 files changed

+86
-78
lines changed

3 files changed

+86
-78
lines changed

WordPress/Tests/WP/OptionAutoloadUnitTest.php

Lines changed: 86 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -32,85 +32,93 @@ public function getErrorList() {
3232
/**
3333
* Returns the lines where warnings should occur.
3434
*
35+
* @param string $testFile The name of the file being tested.
36+
*
3537
* @return array<int, int> Key is the line number, value is the number of expected warnings.
3638
*/
37-
public function getWarningList() {
38-
return array(
39-
106 => 1,
40-
107 => 1,
41-
108 => 1,
42-
109 => 1,
43-
110 => 1,
44-
115 => 1,
45-
117 => 1,
46-
118 => 1,
47-
119 => 1,
48-
120 => 1,
49-
121 => 1,
50-
122 => 1,
51-
123 => 1,
52-
124 => 1,
53-
125 => 1,
54-
126 => 1,
55-
127 => 1,
56-
128 => 1,
57-
129 => 1,
58-
133 => 1,
59-
135 => 1,
60-
136 => 1,
61-
137 => 1,
62-
138 => 1,
63-
139 => 1,
64-
140 => 1,
65-
141 => 1,
66-
142 => 1,
67-
143 => 1,
68-
147 => 1,
69-
148 => 1,
70-
149 => 1,
71-
150 => 1,
72-
151 => 1,
73-
152 => 1,
74-
153 => 1,
75-
154 => 1,
76-
155 => 1,
77-
156 => 1,
78-
157 => 1,
79-
158 => 1,
80-
163 => 1,
81-
164 => 1,
82-
165 => 1,
83-
166 => 1,
84-
167 => 1,
85-
168 => 1,
86-
173 => 1,
87-
174 => 1,
88-
175 => 1,
89-
176 => 1,
90-
177 => 1,
91-
178 => 1,
92-
179 => 1,
93-
185 => 1,
94-
192 => 1,
95-
194 => 1,
96-
195 => 1,
97-
196 => 1,
98-
197 => 1,
99-
198 => 1,
100-
199 => 1,
101-
200 => 1,
102-
202 => 1,
103-
203 => 1,
104-
204 => 1,
105-
205 => 1,
106-
208 => 1,
107-
209 => 1,
108-
210 => 1,
109-
211 => 1,
110-
216 => 1,
111-
222 => 1,
112-
224 => 1,
113-
227 => 1,
114-
);
39+
public function getWarningList( $testFile = '' ) {
40+
switch ( $testFile ) {
41+
case 'OptionAutoloadUnitTest.1.inc':
42+
return array(
43+
106 => 1,
44+
107 => 1,
45+
108 => 1,
46+
109 => 1,
47+
110 => 1,
48+
115 => 1,
49+
117 => 1,
50+
118 => 1,
51+
119 => 1,
52+
120 => 1,
53+
121 => 1,
54+
122 => 1,
55+
123 => 1,
56+
124 => 1,
57+
125 => 1,
58+
126 => 1,
59+
127 => 1,
60+
128 => 1,
61+
129 => 1,
62+
133 => 1,
63+
135 => 1,
64+
136 => 1,
65+
137 => 1,
66+
138 => 1,
67+
139 => 1,
68+
140 => 1,
69+
141 => 1,
70+
142 => 1,
71+
143 => 1,
72+
147 => 1,
73+
148 => 1,
74+
149 => 1,
75+
150 => 1,
76+
151 => 1,
77+
152 => 1,
78+
153 => 1,
79+
154 => 1,
80+
155 => 1,
81+
156 => 1,
82+
157 => 1,
83+
158 => 1,
84+
163 => 1,
85+
164 => 1,
86+
165 => 1,
87+
166 => 1,
88+
167 => 1,
89+
168 => 1,
90+
173 => 1,
91+
174 => 1,
92+
175 => 1,
93+
176 => 1,
94+
177 => 1,
95+
178 => 1,
96+
179 => 1,
97+
185 => 1,
98+
192 => 1,
99+
194 => 1,
100+
195 => 1,
101+
196 => 1,
102+
197 => 1,
103+
198 => 1,
104+
199 => 1,
105+
200 => 1,
106+
202 => 1,
107+
203 => 1,
108+
204 => 1,
109+
205 => 1,
110+
208 => 1,
111+
209 => 1,
112+
210 => 1,
113+
211 => 1,
114+
216 => 1,
115+
222 => 1,
116+
224 => 1,
117+
227 => 1,
118+
);
119+
120+
default:
121+
return array();
122+
}
115123
}
116124
}

0 commit comments

Comments
 (0)