Skip to content

Commit 4081e9e

Browse files
committed
Rename test file to allow for more test files
1 parent 44c338e commit 4081e9e

3 files changed

Lines changed: 25 additions & 16 deletions

File tree

src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc renamed to src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.1.inc

File renamed without changes.

src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed renamed to src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.1.inc.fixed

File renamed without changes.

src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,31 @@ final class ReturnTypeDeclarationUnitTest extends AbstractSniffTestCase
2727
* The key of the array should represent the line number and the value
2828
* should represent the number of errors that should occur on that line.
2929
*
30+
* @param string $testFile The name of the file being tested.
31+
*
3032
* @return array<int, int>
3133
*/
32-
protected function getErrorList()
34+
protected function getErrorList($testFile = '')
3335
{
34-
return [
35-
27 => 1,
36-
28 => 1,
37-
35 => 2,
38-
41 => 2,
39-
48 => 2,
40-
52 => 1,
41-
55 => 1,
42-
56 => 1,
43-
59 => 1,
44-
60 => 1,
45-
62 => 1,
46-
64 => 1,
47-
];
36+
switch ($testFile) {
37+
case 'ReturnTypeDeclarationUnitTest.1.inc':
38+
return [
39+
27 => 1,
40+
28 => 1,
41+
35 => 2,
42+
41 => 2,
43+
48 => 2,
44+
52 => 1,
45+
55 => 1,
46+
56 => 1,
47+
59 => 1,
48+
60 => 1,
49+
62 => 1,
50+
64 => 1,
51+
];
52+
default:
53+
return [];
54+
}
4855
}
4956

5057

@@ -54,9 +61,11 @@ protected function getErrorList()
5461
* The key of the array should represent the line number and the value
5562
* should represent the number of warnings that should occur on that line.
5663
*
64+
* @param string $testFile The name of the file being tested.
65+
*
5766
* @return array<int, int>
5867
*/
59-
protected function getWarningList()
68+
protected function getWarningList($testFile = '')
6069
{
6170
return [];
6271
}

0 commit comments

Comments
 (0)