forked from WordPress/WordPress-Coding-Standards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectDatabaseQueryUnitTest.php
More file actions
117 lines (112 loc) · 2.34 KB
/
Copy pathDirectDatabaseQueryUnitTest.php
File metadata and controls
117 lines (112 loc) · 2.34 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
117
<?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\DB;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
/**
* Unit test class for the DirectDatabaseQuery sniff.
*
* @since 0.3.0
* @since 0.13.0 Class name changed: this class is now namespaced.
* @since 1.0.0 This sniff has been moved from the `VIP` category to the `DB` category.
*
* @covers \WordPressCS\WordPress\Helpers\RulesetPropertyHelper
* @covers \WordPressCS\WordPress\Sniffs\DB\DirectDatabaseQuerySniff
*/
final class DirectDatabaseQueryUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList() {
return array();
}
/**
* Returns the lines where warnings should occur.
*
* @param string $testFile The name of the test file being run.
*
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList( $testFile = '' ) {
switch ( $testFile ) {
case 'DirectDatabaseQueryUnitTest.1.inc':
return array(
5 => 2,
12 => 1,
26 => 2,
27 => 2,
28 => 1,
29 => 1,
38 => 2,
44 => 2,
60 => 1,
61 => 1,
62 => 1,
63 => 1,
65 => 2,
66 => 2,
67 => 2,
80 => 1,
81 => 1,
82 => 1,
83 => 1,
84 => 1,
85 => 1,
86 => 1,
97 => 1,
114 => 1,
123 => 1,
130 => 1,
141 => 1,
150 => 2,
157 => 2,
168 => 2,
175 => 1,
180 => 1,
185 => 1,
190 => 1,
195 => 1,
200 => 1,
205 => 1,
210 => 1,
215 => 1,
220 => 1,
228 => 2,
235 => 2,
251 => 1,
252 => 1,
265 => 1,
269 => 1,
281 => 1,
287 => 2,
288 => 1,
300 => 1,
306 => 2,
333 => 2,
343 => 1,
350 => 1,
364 => 2,
376 => 1,
393 => 1,
404 => 1,
415 => 1,
426 => 1,
437 => 1,
447 => 1,
454 => 1,
461 => 1,
468 => 1,
475 => 1,
);
default:
return array();
}
}
}