Skip to content

Commit bd5f6dc

Browse files
authored
Add AbstractFixerTestCase::assertRiskiness (#930)
1 parent a255c0e commit bd5f6dc

File tree

49 files changed

+53
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+53
-48
lines changed

tests/Fixer/AbstractFixerTestCase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,9 @@ final protected function lintSource(string $source): ?string
219219

220220
return null;
221221
}
222+
223+
final protected function assertRiskiness(bool $isRisky): void
224+
{
225+
self::assertSame($isRisky, $this->fixer->isRisky());
226+
}
222227
}

tests/Fixer/CommentSurroundedBySpacesFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class CommentSurroundedBySpacesFixerTest extends AbstractFixerTestCase
2020
{
2121
public function testIsRisky(): void
2222
{
23-
self::assertFalse($this->fixer->isRisky());
23+
self::assertRiskiness(false);
2424
}
2525

2626
/**

tests/Fixer/CommentedOutFunctionFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testConfiguration(): void
3131

3232
public function testIsRisky(): void
3333
{
34-
self::assertTrue($this->fixer->isRisky());
34+
self::assertRiskiness(true);
3535
}
3636

3737
/**

tests/Fixer/ConstructorEmptyBracesFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class ConstructorEmptyBracesFixerTest extends AbstractFixerTestCase
2020
{
2121
public function testIsRisky(): void
2222
{
23-
self::assertFalse($this->fixer->isRisky());
23+
self::assertRiskiness(false);
2424
}
2525

2626
/**

tests/Fixer/DataProviderNameFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testConfiguration(): void
3838

3939
public function testIsRisky(): void
4040
{
41-
self::assertTrue($this->fixer->isRisky());
41+
self::assertRiskiness(true);
4242
}
4343

4444
public function testSuccessorName(): void

tests/Fixer/DataProviderReturnTypeFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function notProvider(): array {}
4040

4141
public function testIsRisky(): void
4242
{
43-
self::assertTrue($this->fixer->isRisky());
43+
self::assertRiskiness(true);
4444
}
4545

4646
public function testSuccessorName(): void

tests/Fixer/DataProviderStaticFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class DataProviderStaticFixerTest extends AbstractFixerTestCase
2525
{
2626
public function testIsRisky(): void
2727
{
28-
self::assertTrue($this->fixer->isRisky());
28+
self::assertRiskiness(true);
2929
}
3030

3131
public function testSuccessorName(): void

tests/Fixer/DeclareAfterOpeningTagFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class DeclareAfterOpeningTagFixerTest extends AbstractFixerTestCase
2020
{
2121
public function testIsRisky(): void
2222
{
23-
self::assertFalse($this->fixer->isRisky());
23+
self::assertRiskiness(false);
2424
}
2525

2626
/**

tests/Fixer/EmptyFunctionBodyFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class EmptyFunctionBodyFixerTest extends AbstractFixerTestCase
2020
{
2121
public function testIsRisky(): void
2222
{
23-
self::assertFalse($this->fixer->isRisky());
23+
self::assertRiskiness(false);
2424
}
2525

2626
/**

tests/Fixer/InternalClassCasingFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class InternalClassCasingFixerTest extends AbstractFixerTestCase
2424
{
2525
public function testIsRisky(): void
2626
{
27-
self::assertFalse($this->fixer->isRisky());
27+
self::assertRiskiness(false);
2828
}
2929

3030
public function testSuccessorName(): void

0 commit comments

Comments
 (0)