Skip to content

Commit

Permalink
ProperEscapingFunction: Prep for multi-file tests
Browse files Browse the repository at this point in the history
Renames the singular test `.inc` file to include a number, to allow for more incoming test files.
  • Loading branch information
GaryJones committed Feb 5, 2023
1 parent e250d8e commit 3c5a8bb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,51 @@ class ProperEscapingFunctionUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of errors>
*/
public function getErrorList() {
return [
3 => 1,
5 => 1,
15 => 1,
17 => 1,
21 => 1,
23 => 1,
33 => 1,
37 => 1,
41 => 1,
45 => 1,
48 => 1,
62 => 1,
63 => 1,
64 => 1,
65 => 1,
67 => 1,
68 => 1,
69 => 1,
72 => 1,
73 => 1,
74 => 1,
75 => 1,
76 => 1,
77 => 1,
78 => 1,
79 => 1,
80 => 1,
82 => 1,
92 => 1,
97 => 1,
102 => 1,
104 => 1,
];
public function getErrorList( $testFile = '' ) {
switch ( $testFile ) {
case 'ProperEscapingFunctionUnitTest.1.inc':
return [
3 => 1,
5 => 1,
15 => 1,
17 => 1,
21 => 1,
23 => 1,
33 => 1,
37 => 1,
41 => 1,
45 => 1,
48 => 1,
62 => 1,
63 => 1,
64 => 1,
65 => 1,
67 => 1,
68 => 1,
69 => 1,
72 => 1,
73 => 1,
74 => 1,
75 => 1,
76 => 1,
77 => 1,
78 => 1,
79 => 1,
80 => 1,
82 => 1,
92 => 1,
97 => 1,
102 => 1,
104 => 1,
];

default:
return [];
}
}

/**
Expand Down

0 comments on commit 3c5a8bb

Please sign in to comment.