Skip to content

Commit 874f4cb

Browse files
authored
Merge pull request #271 from PHPCSStandards/feature/tests-various-normalize-dataprovider-arrays
Tests/various: normalize data provider arrays
2 parents e332340 + 2621fc0 commit 874f4cb

File tree

4 files changed

+35
-13
lines changed

4 files changed

+35
-13
lines changed

tests/Core/File/FindImplementedInterfaceNamesTest.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public static function dataImplementedInterface()
8686
],
8787
'class implements single interface, unqualified' => [
8888
'identifier' => '/* testClassImplementsSingle */',
89-
'expected' => ['testFIINInterface'],
89+
'expected' => [
90+
'testFIINInterface',
91+
],
9092
],
9193
'class implements multiple interfaces' => [
9294
'identifier' => '/* testClassImplementsMultiple */',
@@ -97,11 +99,15 @@ public static function dataImplementedInterface()
9799
],
98100
'class implements single interface, fully qualified' => [
99101
'identifier' => '/* testImplementsFullyQualified */',
100-
'expected' => ['\PHP_CodeSniffer\Tests\Core\File\testFIINInterface'],
102+
'expected' => [
103+
'\PHP_CodeSniffer\Tests\Core\File\testFIINInterface',
104+
],
101105
],
102106
'class implements single interface, partially qualified' => [
103107
'identifier' => '/* testImplementsPartiallyQualified */',
104-
'expected' => ['Core\File\RelativeInterface'],
108+
'expected' => [
109+
'Core\File\RelativeInterface',
110+
],
105111
],
106112
'class extends and implements' => [
107113
'identifier' => '/* testClassThatExtendsAndImplements */',
@@ -123,7 +129,9 @@ public static function dataImplementedInterface()
123129
],
124130
'enum implements single interface, unqualified' => [
125131
'identifier' => '/* testEnumImplementsSingle */',
126-
'expected' => ['Colorful'],
132+
'expected' => [
133+
'Colorful',
134+
],
127135
],
128136
'enum implements multiple interfaces, unqualified + fully qualified' => [
129137
'identifier' => '/* testBackedEnumImplementsMulti */',
@@ -134,7 +142,9 @@ public static function dataImplementedInterface()
134142
],
135143
'anon class implements single interface, unqualified' => [
136144
'identifier' => '/* testAnonClassImplementsSingle */',
137-
'expected' => ['testFIINInterface'],
145+
'expected' => [
146+
'testFIINInterface',
147+
],
138148
],
139149
'parse error - implements keyword, but no interface name' => [
140150
'identifier' => '/* testMissingImplementsName */',

tests/Core/File/GetMethodParametersTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,15 @@ public function testNoParams($commentString, $targetTokenType=[T_FUNCTION, T_CLO
143143
public static function dataNoParams()
144144
{
145145
return [
146-
'FunctionNoParams' => ['/* testFunctionNoParams */'],
147-
'ClosureNoParams' => ['/* testClosureNoParams */'],
146+
'FunctionNoParams' => [
147+
'commentString' => '/* testFunctionNoParams */',
148+
],
149+
'ClosureNoParams' => [
150+
'commentString' => '/* testClosureNoParams */',
151+
],
148152
'ClosureUseNoParams' => [
149-
'/* testClosureUseNoParams */',
150-
T_USE,
153+
'commentString' => '/* testClosureUseNoParams */',
154+
'targetTokenType' => T_USE,
151155
],
152156
];
153157

tests/Core/Filters/GitModifiedTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,18 @@ public static function dataAcceptOnlyGitModified()
112112

113113
'single file marked as git modified - file in root dir' => [
114114
'inputPaths' => $fakeFileList,
115-
'outputGitModified' => ['autoload.php'],
115+
'outputGitModified' => [
116+
'autoload.php',
117+
],
116118
'expectedOutput' => [
117119
$basedir.'/autoload.php',
118120
],
119121
],
120122
'single file marked as git modified - file in sub dir' => [
121123
'inputPaths' => $fakeFileList,
122-
'outputGitModified' => ['src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php'],
124+
'outputGitModified' => [
125+
'src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php',
126+
],
123127
'expectedOutput' => [
124128
$basedir.'/src',
125129
$basedir.'/src/Standards',

tests/Core/Filters/GitStagedTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,18 @@ public static function dataAcceptOnlyGitStaged()
112112

113113
'single file marked as git modified - file in root dir' => [
114114
'inputPaths' => $fakeFileList,
115-
'outputGitStaged' => ['autoload.php'],
115+
'outputGitStaged' => [
116+
'autoload.php',
117+
],
116118
'expectedOutput' => [
117119
$basedir.'/autoload.php',
118120
],
119121
],
120122
'single file marked as git modified - file in sub dir' => [
121123
'inputPaths' => $fakeFileList,
122-
'outputGitStaged' => ['src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php'],
124+
'outputGitStaged' => [
125+
'src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php',
126+
],
123127
'expectedOutput' => [
124128
$basedir.'/src',
125129
$basedir.'/src/Standards',

0 commit comments

Comments
 (0)