diff --git a/tests/Issues/Issue594/Issue594Test.php b/tests/Issues/Issue594/Issue594Test.php index a4ade130186..1eae5589a13 100644 --- a/tests/Issues/Issue594/Issue594Test.php +++ b/tests/Issues/Issue594/Issue594Test.php @@ -7,13 +7,24 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class Issue594Test extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture594.php.inc']); + $this->doTestFile($file); } public function getRectorClass(): string { return GetRequestRector::class; } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture594.php.inc']; + } } diff --git a/tests/Issues/Issue835/Issue835Test.php b/tests/Issues/Issue835/Issue835Test.php index 35cccd0bb79..b5fe10f48a1 100644 --- a/tests/Issues/Issue835/Issue835Test.php +++ b/tests/Issues/Issue835/Issue835Test.php @@ -6,9 +6,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class Issue835Test extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture835.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture835.php.inc']; } protected function provideConfig(): string diff --git a/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php b/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php index 10e2c7a189c..0750474fa7b 100644 --- a/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php +++ b/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php @@ -7,9 +7,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RenameAnnotationRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/Architecture/DependencyInjection/ActionInjectionToConstructorInjectionRector/ActionInjectionToConstructorInjectionRectorTest.php b/tests/Rector/Architecture/DependencyInjection/ActionInjectionToConstructorInjectionRector/ActionInjectionToConstructorInjectionRectorTest.php index f93e6bb0430..ac98ffc9cc2 100644 --- a/tests/Rector/Architecture/DependencyInjection/ActionInjectionToConstructorInjectionRector/ActionInjectionToConstructorInjectionRectorTest.php +++ b/tests/Rector/Architecture/DependencyInjection/ActionInjectionToConstructorInjectionRector/ActionInjectionToConstructorInjectionRectorTest.php @@ -19,9 +19,21 @@ final class ActionInjectionToConstructorInjectionRectorTest extends AbstractRect $parameterProvider->changeParameter(Option::KERNEL_CLASS_PARAMETER, SomeKernelClass::class); } - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php b/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php index 487dde92428..40dcfb44018 100644 --- a/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php +++ b/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php @@ -7,21 +7,29 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class AnnotatedPropertyInjectToConstructorInjectionRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - __DIR__ . '/Fixture/fixture5.php.inc', - __DIR__ . '/Fixture/fixture6.php.inc', - __DIR__ . '/Fixture/fixture7.php.inc', + $this->doTestFile($file); + } - __DIR__ . '/Fixture/parent_constructor.php.inc', - __DIR__ . '/Fixture/parent_constructor_with_own_inject.php.inc', - __DIR__ . '/Fixture/parent_constructor_with_middle_class.php.inc', - ]); + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; + yield [__DIR__ . '/Fixture/fixture5.php.inc']; + yield [__DIR__ . '/Fixture/fixture6.php.inc']; + yield [__DIR__ . '/Fixture/fixture7.php.inc']; + yield [__DIR__ . '/Fixture/parent_constructor.php.inc']; + yield [__DIR__ . '/Fixture/parent_constructor_with_own_inject.php.inc']; + yield [__DIR__ . '/Fixture/parent_constructor_with_middle_class.php.inc']; } protected function getRectorClass(): string diff --git a/tests/Rector/Architecture/DoctrineRepositoryAsService/DoctrineRepositoryAsServiceTest.php b/tests/Rector/Architecture/DoctrineRepositoryAsService/DoctrineRepositoryAsServiceTest.php index eb8ea402130..a5e3751aa21 100644 --- a/tests/Rector/Architecture/DoctrineRepositoryAsService/DoctrineRepositoryAsServiceTest.php +++ b/tests/Rector/Architecture/DoctrineRepositoryAsService/DoctrineRepositoryAsServiceTest.php @@ -11,9 +11,21 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; */ final class DoctrineRepositoryAsServiceTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/PostController.php']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/PostController.php']; } protected function provideConfig(): string diff --git a/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php b/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php index 08d81bc7e73..161a10f8d21 100644 --- a/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php +++ b/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php @@ -9,9 +9,21 @@ use Rector\Tests\Rector\Architecture\Factory\NewObjectToFactoryCreateRector\Sour final class NewObjectToFactoryCreateRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php b/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php index d64ad54e186..4496a853dce 100644 --- a/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php +++ b/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php @@ -9,15 +9,24 @@ use Rector\Tests\Rector\Argument\ArgumentAdderRector\Source\SomeParentClient; final class ArgumentAdderRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/scoped.php.inc', - __DIR__ . '/Fixture/already_added.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/scoped.php.inc']; + yield [__DIR__ . '/Fixture/already_added.php.inc']; } /** diff --git a/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php b/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php index 008209b9cb9..5db3574c8c7 100644 --- a/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php +++ b/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php @@ -7,13 +7,22 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class ArgumentDefaultValueReplacerRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; } /** diff --git a/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php b/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php index 09718672661..8080709595b 100644 --- a/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php +++ b/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php @@ -10,13 +10,22 @@ use Symfony\Component\Yaml\Yaml; final class ArgumentRemoverRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/remove_in_middle.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/remove_in_middle.php.inc']; } /** diff --git a/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php b/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php index 45e3b8bb579..31d364850d7 100644 --- a/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php +++ b/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php @@ -9,9 +9,21 @@ use Rector\Tests\Rector\Assign\PropertyAssignToMethodCallRector\Source\MultiChoi final class PropertyAssignToMethodCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php b/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php index 54d423f1ba1..2813e950050 100644 --- a/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php +++ b/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php @@ -8,9 +8,20 @@ use Rector\Tests\Rector\ClassLike\RemoveTraitRector\Source\TraitToBeRemoved; final class RemoveTraitRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/ClassMethod/AddMethodParentCallRector/AddMethodParentCallRectorTest.php b/tests/Rector/ClassMethod/AddMethodParentCallRector/AddMethodParentCallRectorTest.php index 041626a26f6..51a701273cc 100644 --- a/tests/Rector/ClassMethod/AddMethodParentCallRector/AddMethodParentCallRectorTest.php +++ b/tests/Rector/ClassMethod/AddMethodParentCallRector/AddMethodParentCallRectorTest.php @@ -8,9 +8,21 @@ use Rector\Tests\Rector\ClassMethod\AddMethodParentCallRector\Source\ParentClass final class AddMethodParentCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/skip_already_has.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/skip_already_has.php.inc']; } /** diff --git a/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php b/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php index ae9e4f1ed36..3a575fa1543 100644 --- a/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php +++ b/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php @@ -8,9 +8,21 @@ use Rector\Tests\Rector\ClassMethod\AddReturnTypeDeclarationRector\Source\PHPUni final class AddReturnTypeDeclarationRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/extended_parent.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/extended_parent.php.inc']; } /** diff --git a/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php b/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php index 8f24c3f33e8..96b9008f07c 100644 --- a/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php +++ b/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php @@ -8,9 +8,21 @@ use Rector\Tests\Rector\ClassMethod\WrapReturnRector\Source\SomeReturnClass; final class WrapReturnRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/already_array.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/already_array.php.inc']; } /** diff --git a/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php b/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php index 171129643cc..c138d7827e2 100644 --- a/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php +++ b/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php @@ -11,15 +11,24 @@ use Rector\Tests\Rector\Class_\ParentClassToTraitsRector\Source\SomeTrait; final class ParentClassToTraitsRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - __DIR__ . '/Fixture/fixture5.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; + yield [__DIR__ . '/Fixture/fixture5.php.inc']; } /** diff --git a/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php b/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php index c015f8a3aad..a28b33ba9a6 100644 --- a/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php +++ b/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php @@ -9,9 +9,20 @@ use Rector\Tests\Rector\Constant\RenameClassConstantRector\Source\LocalFormEvent final class RenameClassConstantRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php b/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php index 5ea42641cc0..186cf2444ea 100644 --- a/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php +++ b/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php @@ -8,9 +8,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RenameClassConstantsUseToStringsRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php b/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php index cc6b62e93d3..cdeaca4db14 100644 --- a/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php +++ b/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php @@ -7,9 +7,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class FunctionToNewRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php b/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php index 92bf7c1b29b..2d5367fdb06 100644 --- a/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php +++ b/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php @@ -7,9 +7,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class FunctionToMethodCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php b/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php index b2b98cbb308..8860daf2926 100644 --- a/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php +++ b/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php @@ -7,9 +7,21 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class FunctionToStaticCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php b/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php index a8d4d7c1245..15638a22bc6 100644 --- a/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php +++ b/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php @@ -7,13 +7,22 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RenameFunctionRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/double_function.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/double_function.php.inc']; } /** diff --git a/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php b/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php index 6a62fd2aaf2..9f7b0ded8de 100644 --- a/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php +++ b/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php @@ -9,9 +9,21 @@ use Rector\Tests\Rector\Interface_\MergeInterfacesRector\Source\SomeOldInterface final class MergeInterfacesRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php b/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php index 9f6f2266c83..58a23b206da 100644 --- a/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php +++ b/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php @@ -8,9 +8,21 @@ use Rector\Tests\Rector\Interface_\RemoveInterfacesRector\Source\SomeInterface; final class RemoveInterfacesRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php b/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php index 17a53039009..ee7c10643cf 100644 --- a/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php +++ b/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php @@ -9,14 +9,23 @@ use Rector\Tests\Rector\MagicDisclosure\GetAndSetToMethodCallRector\Source\SomeC final class GetAndSetToMethodCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/get.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/klarka.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/get.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/klarka.php.inc']; } /** diff --git a/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php b/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php index dfcd2612297..00fe1b6ec76 100644 --- a/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php +++ b/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php @@ -8,9 +8,20 @@ use Symfony\Component\Config\ConfigCache; final class ToStringToMethodCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php b/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php index 6869ad68d14..e89da70f04f 100644 --- a/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php +++ b/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php @@ -8,9 +8,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class UnsetAndIssetToMethodCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php b/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php index 2fb9f9cc129..ce8be920eb3 100644 --- a/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php +++ b/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php @@ -8,14 +8,23 @@ use Rector\Tests\Rector\MethodBody\FluentReplaceRector\Source\FluentInterfaceCla final class FluentReplaceRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/some_command.php.inc', - __DIR__ . '/Fixture/multiple_some_command.php.inc', - __DIR__ . '/Fixture/skip_date_time_modify_command.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/some_command.php.inc']; + yield [__DIR__ . '/Fixture/multiple_some_command.php.inc']; + yield [__DIR__ . '/Fixture/skip_date_time_modify_command.php.inc']; } /** diff --git a/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php b/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php index 42a7ed22989..e57da7e2402 100644 --- a/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php +++ b/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php @@ -8,14 +8,23 @@ use Rector\Tests\Rector\MethodBody\NormalToFluentRector\Source\FluentInterfaceCl final class NormalToFluentRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; } /** diff --git a/tests/Rector/MethodBody/ReturnThisRemoveRector/ReturnThisRemoveRectorTest.php b/tests/Rector/MethodBody/ReturnThisRemoveRector/ReturnThisRemoveRectorTest.php index f15b4f3bca0..c7b1472bd56 100644 --- a/tests/Rector/MethodBody/ReturnThisRemoveRector/ReturnThisRemoveRectorTest.php +++ b/tests/Rector/MethodBody/ReturnThisRemoveRector/ReturnThisRemoveRectorTest.php @@ -7,13 +7,22 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class ReturnThisRemoveRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; } /** diff --git a/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php b/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php index a9d923ce59e..fe99ba6c408 100644 --- a/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php +++ b/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php @@ -8,9 +8,20 @@ use Rector\Tests\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgumentsRec final class MethodCallToAnotherMethodCallWithArgumentsRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php b/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php index 85896d0f97a..d9428867c1a 100644 --- a/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php +++ b/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php @@ -9,14 +9,23 @@ use Rector\Tests\Rector\MethodCall\RenameMethodCallRector\Source\ClassMethodToBe final class RenameMethodCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; } /** diff --git a/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php b/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php index 6817363e307..e9636f5958c 100644 --- a/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php +++ b/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php @@ -10,19 +10,28 @@ use Rector\Tests\Rector\MethodCall\RenameMethodRector\Source\FormMacros; final class RenameMethodRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - __DIR__ . '/Fixture/fixture5.php.inc', - __DIR__ . '/Fixture/fixture6.php.inc', - __DIR__ . '/Fixture/under_anonymous_class.php.inc', - __DIR__ . '/Fixture/SomeClass.php', - __DIR__ . '/Fixture/nette_to_symfony_presenter.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; + yield [__DIR__ . '/Fixture/fixture5.php.inc']; + yield [__DIR__ . '/Fixture/fixture6.php.inc']; + yield [__DIR__ . '/Fixture/under_anonymous_class.php.inc']; + yield [__DIR__ . '/Fixture/SomeClass.php']; + yield [__DIR__ . '/Fixture/nette_to_symfony_presenter.php.inc']; } /** diff --git a/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php b/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php index df582cc2df3..bc4e8503d84 100644 --- a/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php +++ b/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php @@ -9,9 +9,21 @@ use Rector\Tests\Rector\MethodCall\RenameStaticMethodRector\Source\FormMacros; final class RenameStaticMethodRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/MethodCall/ServiceGetterToConstructorInjectionRector/ServiceGetterToConstructorInjectionRectorTest.php b/tests/Rector/MethodCall/ServiceGetterToConstructorInjectionRector/ServiceGetterToConstructorInjectionRectorTest.php index 99efef7054f..e51d3ce007c 100644 --- a/tests/Rector/MethodCall/ServiceGetterToConstructorInjectionRector/ServiceGetterToConstructorInjectionRectorTest.php +++ b/tests/Rector/MethodCall/ServiceGetterToConstructorInjectionRector/ServiceGetterToConstructorInjectionRectorTest.php @@ -9,9 +9,20 @@ use Rector\Tests\Rector\MethodCall\ServiceGetterToConstructorInjectionRector\Sou final class ServiceGetterToConstructorInjectionRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php b/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php index b71cd4d94c1..d088e21ad17 100644 --- a/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php +++ b/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php @@ -7,17 +7,26 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class PseudoNamespaceToNamespaceRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - __DIR__ . '/Fixture/fixture5.php.inc', - __DIR__ . '/Fixture/fixture6.php.inc', - __DIR__ . '/Fixture/var_doc.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; + yield [__DIR__ . '/Fixture/fixture5.php.inc']; + yield [__DIR__ . '/Fixture/fixture6.php.inc']; + yield [__DIR__ . '/Fixture/var_doc.php.inc']; } /** diff --git a/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php b/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php index 68a92350b4b..c741aaf2fcc 100644 --- a/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php +++ b/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php @@ -7,15 +7,24 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RenameNamespaceRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - __DIR__ . '/Fixture/fixture5.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; + yield [__DIR__ . '/Fixture/fixture5.php.inc']; } /** diff --git a/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php b/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php index 9891e37b70a..3d8085b75bf 100644 --- a/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php +++ b/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php @@ -9,9 +9,20 @@ use Rector\Tests\Rector\New_\NewToStaticCallRector\Source\IntoStaticClass; final class NewToStaticCallRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/Property/InjectAnnotationClassRector/InjectAnnotationClassRectorTest.php b/tests/Rector/Property/InjectAnnotationClassRector/InjectAnnotationClassRectorTest.php index 8aee8112f10..28ca952ee82 100644 --- a/tests/Rector/Property/InjectAnnotationClassRector/InjectAnnotationClassRectorTest.php +++ b/tests/Rector/Property/InjectAnnotationClassRector/InjectAnnotationClassRectorTest.php @@ -19,20 +19,33 @@ final class InjectAnnotationClassRectorTest extends AbstractRectorTestCase $parameterProvider->changeParameter(Option::KERNEL_CLASS_PARAMETER, SomeKernelClass::class); } - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [ // JMS __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - __DIR__ . '/Fixture/fixture4.php.inc', - __DIR__ . '/Fixture/fixture5.php.inc', + ]; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; + yield [__DIR__ . '/Fixture/fixture4.php.inc']; + yield [__DIR__ . '/Fixture/fixture5.php.inc']; + yield [ // PHP DI __DIR__ . '/Fixture/inject_from_var.php.inc', - __DIR__ . '/Fixture/inject_from_var2.php.inc', - __DIR__ . '/Fixture/inject_from_var3.php.inc', - ]); + ]; + yield [__DIR__ . '/Fixture/inject_from_var2.php.inc']; + yield [__DIR__ . '/Fixture/inject_from_var3.php.inc']; } /** diff --git a/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php b/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php index 2d63e2c25ff..beca8b3153f 100644 --- a/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php +++ b/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php @@ -8,9 +8,21 @@ use Rector\Tests\Rector\Property\PropertyToMethodRector\Source\Translator; final class PropertyToMethodRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php b/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php index f1d3de02863..84ff87ed156 100644 --- a/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php +++ b/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php @@ -8,9 +8,20 @@ use Rector\Tests\Rector\Property\RenamePropertyRector\Source\ClassWithProperties final class RenamePropertyRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/RectorOrder/RectorOrderTest.php b/tests/Rector/RectorOrder/RectorOrderTest.php index f206bf0f5bb..be8d596df1b 100644 --- a/tests/Rector/RectorOrder/RectorOrderTest.php +++ b/tests/Rector/RectorOrder/RectorOrderTest.php @@ -12,9 +12,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; */ final class RectorOrderTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php b/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php index 42da31f1b72..33e2f956308 100644 --- a/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php +++ b/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php @@ -8,9 +8,20 @@ use Rector\Tests\Rector\StaticCall\StaticCallToFunctionRector\Source\SomeOldStat final class StaticCallToFunctionRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php b/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php index a8fa2ac0051..2dbb499da9f 100644 --- a/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php +++ b/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php @@ -7,9 +7,20 @@ use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class StringToClassConstantRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; } /** diff --git a/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php b/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php index 6c5e0bbd7e1..a37b135c692 100644 --- a/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php +++ b/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php @@ -9,12 +9,21 @@ use Rector\Tests\Rector\Typehint\ParentTypehintedArgumentRector\Source\ParserInt final class ParentTypehintedArgumentRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/SomeClassImplementingParserInterface.php', - __DIR__ . '/Fixture/MyMetadataFactory.php', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/SomeClassImplementingParserInterface.php']; + yield [__DIR__ . '/Fixture/MyMetadataFactory.php']; } /** diff --git a/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php b/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php index f5b2a59117f..92562ad9f37 100644 --- a/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php +++ b/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php @@ -8,9 +8,21 @@ use Rector\Tests\Rector\Visibility\ChangeConstantVisibilityRector\Source\ParentO final class ChangeConstantVisibilityRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php b/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php index 5fc8eba9e54..742ff42c1d7 100644 --- a/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php +++ b/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php @@ -8,9 +8,21 @@ use Rector\Tests\Rector\Visibility\ChangeMethodVisibilityRector\Source\ParentObj final class ChangeMethodVisibilityRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; } /** diff --git a/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php b/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php index 77e6b06d045..ceecedba7e0 100644 --- a/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php +++ b/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php @@ -8,13 +8,22 @@ use Rector\Tests\Rector\Visibility\ChangePropertyVisibilityRector\Source\ParentO final class ChangePropertyVisibilityRectorTest extends AbstractRectorTestCase { - public function test(): void + /** + * @dataProvider provideDataForTest() + */ + public function test(string $file): void { - $this->doTestFiles([ - __DIR__ . '/Fixture/fixture.php.inc', - __DIR__ . '/Fixture/fixture2.php.inc', - __DIR__ . '/Fixture/fixture3.php.inc', - ]); + $this->doTestFile($file); + } + + /** + * @return string[] + */ + public function provideDataForTest(): iterable + { + yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture2.php.inc']; + yield [__DIR__ . '/Fixture/fixture3.php.inc']; } /**