Skip to content

Commit 584ef10

Browse files
committed
DB/DirectDatabaseQuery: rename test case file
Doing this to allow for additional test case files.
1 parent 637711c commit 584ef10

File tree

2 files changed

+62
-55
lines changed

2 files changed

+62
-55
lines changed
File renamed without changes.

WordPress/Tests/DB/DirectDatabaseQueryUnitTest.php

Lines changed: 62 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,62 +35,69 @@ public function getErrorList() {
3535
/**
3636
* Returns the lines where warnings should occur.
3737
*
38+
* @param string $testFile The name of the test file being run.
39+
*
3840
* @return array<int, int> Key is the line number, value is the number of expected warnings.
3941
*/
40-
public function getWarningList() {
41-
return array(
42-
5 => 2,
43-
12 => 1,
44-
26 => 2,
45-
27 => 2,
46-
28 => 1,
47-
29 => 1,
48-
38 => 2,
49-
44 => 2,
50-
60 => 1,
51-
61 => 1,
52-
62 => 1,
53-
63 => 1,
54-
65 => 2,
55-
66 => 2,
56-
67 => 2,
57-
80 => 1,
58-
81 => 1,
59-
82 => 1,
60-
83 => 1,
61-
84 => 1,
62-
85 => 1,
63-
86 => 1,
64-
97 => 1,
65-
114 => 1,
66-
123 => 1,
67-
130 => 1,
68-
141 => 1,
69-
150 => 2,
70-
157 => 2,
71-
168 => 2,
72-
175 => 1,
73-
180 => 1,
74-
185 => 1,
75-
190 => 1,
76-
195 => 1,
77-
200 => 1,
78-
205 => 1,
79-
210 => 1,
80-
215 => 1,
81-
220 => 1,
82-
228 => 2,
83-
235 => 2,
84-
251 => 1,
85-
252 => 1,
86-
265 => 1,
87-
269 => 1,
88-
281 => 1,
89-
287 => 2,
90-
288 => 1,
91-
300 => 1,
92-
306 => 2,
93-
333 => 2,
94-
);
42+
public function getWarningList( $testFile = '' ) {
43+
switch ( $testFile ) {
44+
case 'DirectDatabaseQueryUnitTest.1.inc':
45+
return array(
46+
5 => 2,
47+
12 => 1,
48+
26 => 2,
49+
27 => 2,
50+
28 => 1,
51+
29 => 1,
52+
38 => 2,
53+
44 => 2,
54+
60 => 1,
55+
61 => 1,
56+
62 => 1,
57+
63 => 1,
58+
65 => 2,
59+
66 => 2,
60+
67 => 2,
61+
80 => 1,
62+
81 => 1,
63+
82 => 1,
64+
83 => 1,
65+
84 => 1,
66+
85 => 1,
67+
86 => 1,
68+
97 => 1,
69+
114 => 1,
70+
123 => 1,
71+
130 => 1,
72+
141 => 1,
73+
150 => 2,
74+
157 => 2,
75+
168 => 2,
76+
175 => 1,
77+
180 => 1,
78+
185 => 1,
79+
190 => 1,
80+
195 => 1,
81+
200 => 1,
82+
205 => 1,
83+
210 => 1,
84+
215 => 1,
85+
220 => 1,
86+
228 => 2,
87+
235 => 2,
88+
251 => 1,
89+
252 => 1,
90+
265 => 1,
91+
269 => 1,
92+
281 => 1,
93+
287 => 2,
94+
288 => 1,
95+
300 => 1,
96+
306 => 2,
97+
333 => 2,
98+
);
99+
default:
100+
return array();
101+
}
95102
}
96103
}

0 commit comments

Comments
 (0)