Skip to content

Commit 2c1ee60

Browse files
committed
Cleanup
1 parent e4c18ed commit 2c1ee60

35 files changed

+101
-58
lines changed

tests/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniffTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ class MultiLineArrayEndBracketPlacementSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(
13-
__DIR__ . '/data/multiLineArrayEndBracketPlacementNoErrors.php'
14-
));
12+
$report = self::checkFile(__DIR__ . '/data/multiLineArrayEndBracketPlacementNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1514
}
1615

1716
public function testErrors(): void

tests/Sniffs/Arrays/SingleLineArrayWhitespaceSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class SingleLineArrayWhitespaceSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/singleLineArrayWhitespaceNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/singleLineArrayWhitespaceNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Classes/ConstantSpacingSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public function testErrors(): void
2828

2929
public function testInGlobalNamespaceNoErrors(): void
3030
{
31-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/constantSpacingInGlobalNamespaceNoErrors.php'));
31+
$report = self::checkFile(__DIR__ . '/data/constantSpacingInGlobalNamespaceNoErrors.php');
32+
self::assertNoSniffErrorInFile($report);
3233
}
3334

3435
}

tests/Sniffs/Classes/DisallowMultiConstantDefinitionSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DisallowMultiConstantDefinitionSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/disallowMultiConstantDefinitionNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/disallowMultiConstantDefinitionNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Classes/DisallowMultiPropertyDefinitionSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DisallowMultiPropertyDefinitionSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/disallowMultiPropertyDefinitionNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/disallowMultiPropertyDefinitionNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Classes/EmptyLinesAroundClassBracesSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class EmptyLinesAroundClassBracesSniffTest extends TestCase
99

1010
public function testCorrectCorrectEmptyLines(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/classBracesCorrectEmptyLines.php'));
12+
$report = self::checkFile(__DIR__ . '/data/classBracesCorrectEmptyLines.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testNoEmptyLineAfterOpeningBrace(): void

tests/Sniffs/Classes/PropertySpacingSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class PropertySpacingSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/propertySpacingNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/propertySpacingNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Classes/UnusedPrivateElementsSniffTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,20 @@ public function testErrors(): void
135135

136136
public function testOnlyPublicElements(): void
137137
{
138-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/classWithOnlyPublicElements.php'));
138+
$report = self::checkFile(__DIR__ . '/data/classWithOnlyPublicElements.php');
139+
self::assertNoSniffErrorInFile($report);
139140
}
140141

141142
public function testClassWithSpecialThis(): void
142143
{
143-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/classWithSpecialThis.php'));
144+
$report = self::checkFile(__DIR__ . '/data/classWithSpecialThis.php');
145+
self::assertNoSniffErrorInFile($report);
144146
}
145147

146148
public function testClassWithSpecialSelf(): void
147149
{
148-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/classWithSpecialSelf.php'));
150+
$report = self::checkFile(__DIR__ . '/data/classWithSpecialSelf.php');
151+
self::assertNoSniffErrorInFile($report);
149152
}
150153

151154
public function testClassWithPrivateElementsUsedOnSelfInstance(): void

tests/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DisallowOneLinePropertyDocCommentSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/multiLinePropertyDocCommentNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/multiLinePropertyDocCommentNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Commenting/RequireOneLineDocCommentSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class RequireOneLineDocCommentSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/oneLineDocCommentSniffNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/oneLineDocCommentSniffNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Commenting/RequireOneLinePropertyDocCommentSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class RequireOneLinePropertyDocCommentSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/oneLinePropertyDocCommentNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/oneLinePropertyDocCommentNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/ControlStructures/DisallowShortTernaryOperatorSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DisallowShortTernaryOperatorSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/disallowShortTernaryOperatorNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/disallowShortTernaryOperatorNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/ControlStructures/LanguageConstructWithParenthesesSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class LanguageConstructWithParenthesesSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/languageConstructWithParenthesesNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/languageConstructWithParenthesesNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/ControlStructures/RequireShortTernaryOperatorSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class RequireShortTernaryOperatorSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/requireShortTernaryOperatorNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/requireShortTernaryOperatorNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/ControlStructures/RequireTernaryOperatorSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class RequireTernaryOperatorSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/requireTernaryOperatorNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/requireTernaryOperatorNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Files/LineLengthSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class LineLengthSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/LineLengthSniffNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/LineLengthSniffNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Files/TypeNameMatchesFileNameSniffTest.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,29 @@ public function testError(): void
2828

2929
public function testNoError(): void
3030
{
31-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/rootNamespace/Foo.php', [
31+
$report = self::checkFile(__DIR__ . '/data/rootNamespace/Foo.php', [
3232
'rootNamespaces' => ['tests/Sniffs/Files/data/rootNamespace' => 'RootNamespace'],
3333
'ignoredNamespaces' => ['IgnoredNamespace'],
34-
]));
34+
]);
35+
self::assertNoSniffErrorInFile($report);
3536
}
3637

3738
public function testSkippedDir(): void
3839
{
39-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/rootNamespace/skippedDir/Bar.php', [
40+
$report = self::checkFile(__DIR__ . '/data/rootNamespace/skippedDir/Bar.php', [
4041
'rootNamespaces' => ['tests/Sniffs/Files/data/rootNamespace' => 'RootNamespace'],
4142
'ignoredNamespaces' => ['IgnoredNamespace'],
4243
'skipDirs' => ['skippedDir'],
43-
]));
44+
]);
45+
self::assertNoSniffErrorInFile($report);
4446
}
4547

4648
public function testIgnoredNamespace(): void
4749
{
48-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/ignoredNamespace.php', [
50+
$report = self::checkFile(__DIR__ . '/data/ignoredNamespace.php', [
4951
'ignoredNamespaces' => ['IgnoredNamespace'],
50-
]));
52+
]);
53+
self::assertNoSniffErrorInFile($report);
5154
}
5255

5356
public function testNoNamespace(): void
@@ -86,9 +89,10 @@ public function testRootNamespacesNormalization(): void
8689

8790
public function testWithProvidedBasePathAndNestedSameDirName(): void
8891
{
89-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/data/Foo/Bar.php', [
92+
$report = self::checkFile(__DIR__ . '/data/data/Foo/Bar.php', [
9093
'rootNamespaces' => ['data' => 'Data'],
91-
], [], ['--basepath=' . __DIR__ . '/data']));
94+
], [], ['--basepath=' . __DIR__ . '/data']);
95+
self::assertNoSniffErrorInFile($report);
9296
}
9397

9498
}

tests/Sniffs/Namespaces/AlphabeticallySortedUsesSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ public function testIncorrectOrderOfSimilarNamespaces(): void
6262

6363
public function testPatrikOrder(): void
6464
{
65-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/alphabeticalPatrik.php'));
65+
$report = self::checkFile(__DIR__ . '/data/alphabeticalPatrik.php');
66+
self::assertNoSniffErrorInFile($report);
6667
}
6768

6869
public function testFixable(): void

tests/Sniffs/Namespaces/DisallowGroupUseSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DisallowGroupUseSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/disallowGroupUseNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/disallowGroupUseNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Namespaces/FullyQualifiedClassNameAfterKeywordSniffUseTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ public function testIgnoreUseInNamespace(): void
2020

2121
public function testIgnoreUseInNamespaceWithParenthesis(): void
2222
{
23-
self::assertNoSniffErrorInFile(self::checkFile(
23+
$report = self::checkFile(
2424
__DIR__ . '/data/fullyQualifiedUseNamespaceWithParenthesis.php',
2525
['keywordsToCheck' => ['T_USE']]
26-
));
26+
);
27+
self::assertNoSniffErrorInFile($report);
2728
}
2829

2930
public function testNonFullyQualifiedUse(): void

tests/Sniffs/Namespaces/RequireOneNamespaceInFileSniffTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class RequireOneNamespaceInFileSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/requireOneNamespaceInFileNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/requireOneNamespaceInFileNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void
@@ -24,7 +25,8 @@ public function testErrors(): void
2425

2526
public function testNoNamespaceNoError(): void
2627
{
27-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/requireOneNamespaceInFileNoNamespaceNoErrors.php'));
28+
$report = self::checkFile(__DIR__ . '/data/requireOneNamespaceInFileNoNamespaceNoErrors.php');
29+
self::assertNoSniffErrorInFile($report);
2830
}
2931

3032
}

tests/Sniffs/Operators/DisallowEqualOperatorsSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DisallowEqualOperatorsSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/disallowEqualOperatorsNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/disallowEqualOperatorsNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Operators/DisallowIncrementAndDecrementOperatorsSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DisallowIncrementAndDecrementOperatorsSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/disallowIncrementAndDecrementOperatorsNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/disallowIncrementAndDecrementOperatorsNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/Operators/NegationOperatorSpacingSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class NegationOperatorSpacingSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/negationOperatorSpacingNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/negationOperatorSpacingNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/PHP/ForbiddenClassesSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class ForbiddenClassesSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/forbiddenClasses.php'));
12+
$report = self::checkFile(__DIR__ . '/data/forbiddenClasses.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniffTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ class OptimizedFunctionsWithoutUnpackingSniffTest extends TestCase
99

1010
public function testNoErrorsNamespaced(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/optimizedFunctionsWithoutUnpackingNamespacedNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/optimizedFunctionsWithoutUnpackingNamespacedNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testNoErrorsNotNamespaced(): void
1617
{
17-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/optimizedFunctionsWithoutUnpackingNamespacedNoErrors.php'));
18+
$report = self::checkFile(__DIR__ . '/data/optimizedFunctionsWithoutUnpackingNamespacedNoErrors.php');
19+
self::assertNoSniffErrorInFile($report);
1820
}
1921

2022
public function testErrorsNamespaced(): void

tests/Sniffs/PHP/ShortListSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class ShortListSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/shortListNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/shortListNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

tests/Sniffs/PHP/TypeCastSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class TypeCastSniffTest extends TestCase
99

1010
public function testNoErrors(): void
1111
{
12-
self::assertNoSniffErrorInFile(self::checkFile(__DIR__ . '/data/typeCastNoErrors.php'));
12+
$report = self::checkFile(__DIR__ . '/data/typeCastNoErrors.php');
13+
self::assertNoSniffErrorInFile($report);
1314
}
1415

1516
public function testErrors(): void

0 commit comments

Comments
 (0)