Skip to content

Commit 42cbf42

Browse files
committed
WP/DeprecatedClasses: rename test case file
More tests will be added in a separate file in a subsequent commit.
1 parent ce615fa commit 42cbf42

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

WordPress/Tests/WP/DeprecatedClassesUnitTest.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,24 @@ final class DeprecatedClassesUnitTest extends AbstractSniffUnitTest {
2424
/**
2525
* Returns the lines where errors should occur.
2626
*
27+
* @param string $testFile The test file to check for errors.
28+
*
2729
* @return array<int, int> Key is the line number, value is the number of expected errors.
2830
*/
29-
public function getErrorList() {
30-
$start_line = 9;
31-
$end_line = 28;
32-
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
31+
public function getErrorList( $testFile = '' ) {
32+
switch ( $testFile ) {
33+
case 'DeprecatedClassesUnitTest.1.inc':
34+
$start_line = 9;
35+
$end_line = 28;
36+
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
3337

34-
// Unset the lines related to version comments.
35-
unset( $errors[16], $errors[18], $errors[21], $errors[26] );
38+
// Unset the lines related to version comments.
39+
unset( $errors[16], $errors[18], $errors[21], $errors[26] );
3640

37-
return $errors;
41+
return $errors;
42+
default:
43+
return array();
44+
}
3845
}
3946

4047
/**

0 commit comments

Comments
 (0)