mirror of
https://github.com/WordPress/WordPress-Coding-Standards.git
synced 2025-08-30 03:11:24 +08:00
NamingConventions/ValidFunctionName: rename test case file
This is necessary to be able to create more test case files with syntax errors in a future commit.
This commit is contained in:
parent
00e9af7fde
commit
0076d49824
2 changed files with 38 additions and 30 deletions
|
@ -25,38 +25,46 @@ final class ValidFunctionNameUnitTest 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() {
|
||||
return array(
|
||||
3 => 1,
|
||||
9 => 1,
|
||||
13 => 1,
|
||||
15 => 1,
|
||||
79 => 2,
|
||||
80 => 2,
|
||||
81 => 2,
|
||||
82 => 2,
|
||||
83 => 2,
|
||||
84 => 2,
|
||||
85 => 2,
|
||||
86 => 2,
|
||||
87 => 2,
|
||||
88 => 2,
|
||||
89 => 2,
|
||||
106 => 2,
|
||||
116 => 1,
|
||||
117 => 1,
|
||||
157 => 2,
|
||||
183 => 1,
|
||||
184 => 1,
|
||||
185 => 1,
|
||||
199 => 1,
|
||||
208 => 2,
|
||||
210 => 1,
|
||||
223 => function_exists( 'mb_strtolower' ) ? 1 : 0,
|
||||
224 => 1,
|
||||
);
|
||||
public function getErrorList( $testFile = '' ) {
|
||||
switch ( $testFile ) {
|
||||
case 'ValidFunctionNameUnitTest.1.inc':
|
||||
return array(
|
||||
3 => 1,
|
||||
9 => 1,
|
||||
13 => 1,
|
||||
15 => 1,
|
||||
79 => 2,
|
||||
80 => 2,
|
||||
81 => 2,
|
||||
82 => 2,
|
||||
83 => 2,
|
||||
84 => 2,
|
||||
85 => 2,
|
||||
86 => 2,
|
||||
87 => 2,
|
||||
88 => 2,
|
||||
89 => 2,
|
||||
106 => 2,
|
||||
116 => 1,
|
||||
117 => 1,
|
||||
157 => 2,
|
||||
183 => 1,
|
||||
184 => 1,
|
||||
185 => 1,
|
||||
199 => 1,
|
||||
208 => 2,
|
||||
210 => 1,
|
||||
223 => function_exists( 'mb_strtolower' ) ? 1 : 0,
|
||||
224 => 1,
|
||||
);
|
||||
|
||||
default:
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue