diff --git a/tests/Application/ApplicationFileProcessor/ApplicationFileProcessorTest.php b/tests/Application/ApplicationFileProcessor/ApplicationFileProcessorTest.php deleted file mode 100644 index 8d5581fc8fe..00000000000 --- a/tests/Application/ApplicationFileProcessor/ApplicationFileProcessorTest.php +++ /dev/null @@ -1,54 +0,0 @@ -bootFromConfigFileInfos([new SmartFileInfo(__DIR__ . '/config/configured_rule.php')]); - - /** @var Configuration $configuration */ - $configuration = $this->getService(Configuration::class); - $configuration->setIsDryRun(true); - - $this->applicationFileProcessor = $this->getService(ApplicationFileProcessor::class); - $this->fileFactory = $this->getService(FileFactory::class); - $this->processResultFactory = $this->getService(ProcessResultFactory::class); - } - - public function test(): void - { - $files = $this->fileFactory->createFromPaths([__DIR__ . '/Fixture']); - $this->assertCount(2, $files); - - $this->applicationFileProcessor->run($files); - - $processResult = $this->processResultFactory->create($files); - $this->assertCount(1, $processResult->getFileDiffs()); - } -} diff --git a/tests/Application/ApplicationFileProcessor/Fixture/bar_stays_bar.txt b/tests/Application/ApplicationFileProcessor/Fixture/bar_stays_bar.txt deleted file mode 100644 index ebd7525b336..00000000000 --- a/tests/Application/ApplicationFileProcessor/Fixture/bar_stays_bar.txt +++ /dev/null @@ -1 +0,0 @@ -Bar diff --git a/tests/Application/ApplicationFileProcessor/Fixture/foo_to_bar.txt b/tests/Application/ApplicationFileProcessor/Fixture/foo_to_bar.txt deleted file mode 100644 index bc56c4d8944..00000000000 --- a/tests/Application/ApplicationFileProcessor/Fixture/foo_to_bar.txt +++ /dev/null @@ -1 +0,0 @@ -Foo diff --git a/tests/Application/ApplicationFileProcessor/Source/Contract/TextRectorInterface.php b/tests/Application/ApplicationFileProcessor/Source/Contract/TextRectorInterface.php deleted file mode 100644 index 7c4a322a8b1..00000000000 --- a/tests/Application/ApplicationFileProcessor/Source/Contract/TextRectorInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -textRectors = $textRectors; - } - - /** - * @param File[] $files - */ - public function process(array $files): void - { - foreach ($files as $file) { - $fileContent = $file->getFileContent(); - - foreach ($this->textRectors as $textRector) { - $fileContent = $textRector->refactorContent($fileContent); - } - - $file->changeFileContent($fileContent); - } - } - - public function supports(File $file): bool - { - $smartFileInfo = $file->getSmartFileInfo(); - return $smartFileInfo->hasSuffixes($this->getSupportedFileExtensions()); - } - - /** - * @return string[] - */ - public function getSupportedFileExtensions(): array - { - return ['txt']; - } -} diff --git a/tests/Application/ApplicationFileProcessor/config/configured_rule.php b/tests/Application/ApplicationFileProcessor/config/configured_rule.php deleted file mode 100644 index 8b3054a0ea7..00000000000 --- a/tests/Application/ApplicationFileProcessor/config/configured_rule.php +++ /dev/null @@ -1,14 +0,0 @@ -services(); - $services->set(TextFileProcessor::class); - - $services->set(ChangeTextRector::class); -}; diff --git a/tests/DependencyInjection/ConfigurableRectorImportConfigCallsMergeTest.php b/tests/DependencyInjection/ConfigurableRectorImportConfigCallsMergeTest.php deleted file mode 100644 index b2f803190df..00000000000 --- a/tests/DependencyInjection/ConfigurableRectorImportConfigCallsMergeTest.php +++ /dev/null @@ -1,121 +0,0 @@ -privatesAccessor = new PrivatesAccessor(); - } - - /** - * @dataProvider provideData() - * @param array $expectedConfiguration - */ - public function testMainConfigValues(string $config, array $expectedConfiguration): void - { - $rectorConfigsResolver = new RectorConfigsResolver(); - - $configFileInfos = $rectorConfigsResolver->resolveFromConfigFileInfo(new SmartFileInfo($config)); - $this->bootFromConfigFileInfos($configFileInfos); - - $renameClassRector = $this->getService(RenameClassRector::class); - $oldToNewClasses = $this->privatesAccessor->getPrivateProperty($renameClassRector, 'oldToNewClasses'); - - $this->assertSame($expectedConfiguration, $oldToNewClasses); - } - - public function provideData(): Iterator - { - yield [ - __DIR__ . '/config/main_config_with_only_imports.php', [ - 'old_2' => 'new_2', - 'old_1' => 'new_1', - ], - ]; - - yield [ - __DIR__ . '/config/main_config_with_override_value.php', [ - 'old_2' => 'new_2', - 'old_1' => 'new_1', - 'old_4' => 'new_4', - ], - ]; - - yield [ - __DIR__ . '/config/main_config_with_own_value.php', [ - 'old_2' => 'new_2', - 'old_1' => 'new_1', - 'old_4' => 'new_4', - 'old_3' => 'new_3', - ], - ]; - - yield [ - __DIR__ . '/config/one_set.php', [ - 'PHPUnit_Framework_MockObject_Stub' => 'PHPUnit\Framework\MockObject\Stub', - 'PHPUnit_Framework_MockObject_Stub_Return' => 'PHPUnit\Framework\MockObject\Stub\ReturnStub', - 'PHPUnit_Framework_MockObject_Matcher_Parameters' => 'PHPUnit\Framework\MockObject\Matcher\Parameters', - 'PHPUnit_Framework_MockObject_Matcher_Invocation' => 'PHPUnit\Framework\MockObject\Matcher\Invocation', - 'PHPUnit_Framework_MockObject_MockObject' => 'PHPUnit\Framework\MockObject\MockObject', - 'PHPUnit_Framework_MockObject_Invocation_Object' => 'PHPUnit\Framework\MockObject\Invocation\ObjectInvocation', - ], - ]; - - yield [ - __DIR__ . '/config/one_set_with_own_rename.php', [ - 'Old' => 'New', - 'PHPUnit_Framework_MockObject_Stub' => 'PHPUnit\Framework\MockObject\Stub', - 'PHPUnit_Framework_MockObject_Stub_Return' => 'PHPUnit\Framework\MockObject\Stub\ReturnStub', - 'PHPUnit_Framework_MockObject_Matcher_Parameters' => 'PHPUnit\Framework\MockObject\Matcher\Parameters', - 'PHPUnit_Framework_MockObject_Matcher_Invocation' => 'PHPUnit\Framework\MockObject\Matcher\Invocation', - 'PHPUnit_Framework_MockObject_MockObject' => 'PHPUnit\Framework\MockObject\MockObject', - 'PHPUnit_Framework_MockObject_Invocation_Object' => 'PHPUnit\Framework\MockObject\Invocation\ObjectInvocation', - ], - ]; - - yield [ - __DIR__ . '/config/two_sets.php', [ - 'Twig_SimpleFilter' => 'Twig_Filter', - 'Twig_SimpleFunction' => 'Twig_Function', - 'Twig_SimpleTest' => 'Twig_Test', - 'PHPUnit_Framework_MockObject_Stub' => 'PHPUnit\Framework\MockObject\Stub', - 'PHPUnit_Framework_MockObject_Stub_Return' => 'PHPUnit\Framework\MockObject\Stub\ReturnStub', - 'PHPUnit_Framework_MockObject_Matcher_Parameters' => 'PHPUnit\Framework\MockObject\Matcher\Parameters', - 'PHPUnit_Framework_MockObject_Matcher_Invocation' => 'PHPUnit\Framework\MockObject\Matcher\Invocation', - 'PHPUnit_Framework_MockObject_MockObject' => 'PHPUnit\Framework\MockObject\MockObject', - 'PHPUnit_Framework_MockObject_Invocation_Object' => 'PHPUnit\Framework\MockObject\Invocation\ObjectInvocation', - ], - ]; - - yield [ - __DIR__ . '/config/two_sets_with_own_rename.php', [ - 'Old' => 'New', - 'Twig_SimpleFilter' => 'Twig_Filter', - 'Twig_SimpleFunction' => 'Twig_Function', - 'Twig_SimpleTest' => 'Twig_Test', - 'PHPUnit_Framework_MockObject_Stub' => 'PHPUnit\Framework\MockObject\Stub', - 'PHPUnit_Framework_MockObject_Stub_Return' => 'PHPUnit\Framework\MockObject\Stub\ReturnStub', - 'PHPUnit_Framework_MockObject_Matcher_Parameters' => 'PHPUnit\Framework\MockObject\Matcher\Parameters', - 'PHPUnit_Framework_MockObject_Matcher_Invocation' => 'PHPUnit\Framework\MockObject\Matcher\Invocation', - 'PHPUnit_Framework_MockObject_MockObject' => 'PHPUnit\Framework\MockObject\MockObject', - 'PHPUnit_Framework_MockObject_Invocation_Object' => 'PHPUnit\Framework\MockObject\Invocation\ObjectInvocation', - ], - ]; - } -} diff --git a/tests/DependencyInjection/config/first_config.php b/tests/DependencyInjection/config/first_config.php deleted file mode 100644 index 09f767d5d37..00000000000 --- a/tests/DependencyInjection/config/first_config.php +++ /dev/null @@ -1,16 +0,0 @@ -services(); - $services->set(RenameClassRector::class) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'old_1' => 'new_1', - ], - ]]); -}; diff --git a/tests/DependencyInjection/config/main_config_with_only_imports.php b/tests/DependencyInjection/config/main_config_with_only_imports.php deleted file mode 100644 index d473384108b..00000000000 --- a/tests/DependencyInjection/config/main_config_with_only_imports.php +++ /dev/null @@ -1,14 +0,0 @@ -services(); - $services->set(RenameClassRector::class); - - $containerConfigurator->import(__DIR__ . '/first_config.php'); - $containerConfigurator->import(__DIR__ . '/second_config.php'); -}; diff --git a/tests/DependencyInjection/config/main_config_with_override_value.php b/tests/DependencyInjection/config/main_config_with_override_value.php deleted file mode 100644 index 3b64c0c23a5..00000000000 --- a/tests/DependencyInjection/config/main_config_with_override_value.php +++ /dev/null @@ -1,24 +0,0 @@ -services(); - $services->set(RenameClassRector::class) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'old_2' => 'new_2', - ], - ]]) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'old_4' => 'new_4', - ], - ]]); - - $containerConfigurator->import(__DIR__ . '/first_config.php'); - $containerConfigurator->import(__DIR__ . '/second_config.php'); -}; diff --git a/tests/DependencyInjection/config/main_config_with_own_value.php b/tests/DependencyInjection/config/main_config_with_own_value.php deleted file mode 100644 index 3ede9d5a454..00000000000 --- a/tests/DependencyInjection/config/main_config_with_own_value.php +++ /dev/null @@ -1,24 +0,0 @@ -services(); - $services->set(RenameClassRector::class) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'old_3' => 'new_3', - ], - ]]) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'old_4' => 'new_4', - ], - ]]); - - $containerConfigurator->import(__DIR__ . '/first_config.php'); - $containerConfigurator->import(__DIR__ . '/second_config.php'); -}; diff --git a/tests/DependencyInjection/config/one_set.php b/tests/DependencyInjection/config/one_set.php deleted file mode 100644 index d9f6b72ac22..00000000000 --- a/tests/DependencyInjection/config/one_set.php +++ /dev/null @@ -1,10 +0,0 @@ -import(PHPUnitSetList::PHPUNIT_60); -}; diff --git a/tests/DependencyInjection/config/one_set_with_own_rename.php b/tests/DependencyInjection/config/one_set_with_own_rename.php deleted file mode 100644 index d89c2dbd08e..00000000000 --- a/tests/DependencyInjection/config/one_set_with_own_rename.php +++ /dev/null @@ -1,19 +0,0 @@ -import(PHPUnitSetList::PHPUNIT_60); - - $services = $containerConfigurator->services(); - $services->set(RenameClassRector::class) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'Old' => 'New', - ], - ]]); -}; diff --git a/tests/DependencyInjection/config/second_config.php b/tests/DependencyInjection/config/second_config.php deleted file mode 100644 index 1ac65783ffc..00000000000 --- a/tests/DependencyInjection/config/second_config.php +++ /dev/null @@ -1,17 +0,0 @@ -services(); - $services->set(RenameClassRector::class) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'old_2' => 'new_2', - ], - ], - ]); -}; diff --git a/tests/DependencyInjection/config/two_sets.php b/tests/DependencyInjection/config/two_sets.php deleted file mode 100644 index 6cc66fdcfb1..00000000000 --- a/tests/DependencyInjection/config/two_sets.php +++ /dev/null @@ -1,12 +0,0 @@ -import(PHPUnitSetList::PHPUNIT_60); - $containerConfigurator->import(TwigSetList::TWIG_20); -}; diff --git a/tests/DependencyInjection/config/two_sets_with_own_rename.php b/tests/DependencyInjection/config/two_sets_with_own_rename.php deleted file mode 100644 index 00256684f66..00000000000 --- a/tests/DependencyInjection/config/two_sets_with_own_rename.php +++ /dev/null @@ -1,21 +0,0 @@ -import(PHPUnitSetList::PHPUNIT_60); - $containerConfigurator->import(TwigSetList::TWIG_20); - - $services = $containerConfigurator->services(); - $services->set(RenameClassRector::class) - ->call('configure', [[ - RenameClassRector::OLD_TO_NEW_CLASSES => [ - 'Old' => 'New', - ], - ]]); -}; diff --git a/tests/Exclusion/ExclusionManagerTest.php b/tests/Exclusion/ExclusionManagerTest.php deleted file mode 100644 index 1492083c423..00000000000 --- a/tests/Exclusion/ExclusionManagerTest.php +++ /dev/null @@ -1,36 +0,0 @@ -doTestFileInfo($fileInfo); - } - - /** - * @return Iterator - */ - public function provideData(): Iterator - { - return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/some_config.php'; - } -} diff --git a/tests/Exclusion/Fixture/different_norector.php.inc b/tests/Exclusion/Fixture/different_norector.php.inc deleted file mode 100644 index 8528f67f17d..00000000000 --- a/tests/Exclusion/Fixture/different_norector.php.inc +++ /dev/null @@ -1,33 +0,0 @@ - ------ - diff --git a/tests/Exclusion/Fixture/skip_comment_with_spaces.php.inc b/tests/Exclusion/Fixture/skip_comment_with_spaces.php.inc deleted file mode 100644 index 3baf77094af..00000000000 --- a/tests/Exclusion/Fixture/skip_comment_with_spaces.php.inc +++ /dev/null @@ -1,13 +0,0 @@ -services(); - $services->set(RemoveEmptyClassMethodRector::class); - $services->set(RemoveDeadZeroAndOneOperationRector::class); -}; diff --git a/tests/FileSystem/FilesFinder/ExcludePaths/ExcludePathsTest.php b/tests/FileSystem/FilesFinder/ExcludePaths/ExcludePathsTest.php deleted file mode 100644 index 06a8b097ff9..00000000000 --- a/tests/FileSystem/FilesFinder/ExcludePaths/ExcludePathsTest.php +++ /dev/null @@ -1,22 +0,0 @@ -bootFromConfigFileInfos([new SmartFileInfo(__DIR__ . '/config/config-with-excluded-paths.php')]); - - $filesFinder = $this->getService(FilesFinder::class); - - $foundFileInfos = $filesFinder->findInDirectoriesAndFiles([__DIR__ . '/Source'], ['php']); - $this->assertCount(1, $foundFileInfos); - } -} diff --git a/tests/FileSystem/FilesFinder/ExcludePaths/Source/ShouldBeExcluded/FileWithMissingClass.php b/tests/FileSystem/FilesFinder/ExcludePaths/Source/ShouldBeExcluded/FileWithMissingClass.php deleted file mode 100644 index d5079a07cbb..00000000000 --- a/tests/FileSystem/FilesFinder/ExcludePaths/Source/ShouldBeExcluded/FileWithMissingClass.php +++ /dev/null @@ -1,10 +0,0 @@ -parameters(); - $parameters->set(Option::SKIP, ['*/ShouldBeExcluded/*']); -}; diff --git a/tests/FileSystem/FilesFinder/FilesFinderTest.php b/tests/FileSystem/FilesFinder/FilesFinderTest.php deleted file mode 100644 index dd114dd450e..00000000000 --- a/tests/FileSystem/FilesFinder/FilesFinderTest.php +++ /dev/null @@ -1,65 +0,0 @@ -boot(); - $this->filesFinder = $this->getService(FilesFinder::class); - } - - /** - * @dataProvider provideData() - */ - public function testSingleSuffix(string $suffix, int $count, string $expectedFileName): void - { - $foundFiles = $this->filesFinder->findInDirectoriesAndFiles([__DIR__ . '/Source'], [$suffix]); - $this->assertCount($count, $foundFiles); - - /** @var SmartFileInfo $foundFile */ - $foundFile = array_pop($foundFiles); - $this->assertSame($expectedFileName, $foundFile->getBasename()); - } - - /** - * @return Iterator> - */ - public function provideData(): Iterator - { - yield ['php', 1, 'SomeFile.php']; - yield ['yml', 1, 'some_config.yml']; - yield ['yaml', 1, 'other_config.yaml']; - yield ['php', 1, 'SomeFile.php']; - } - - public function testMultipleSuffixes(): void - { - $foundFiles = $this->filesFinder->findInDirectoriesAndFiles([__DIR__ . '/Source'], ['yaml', 'yml']); - $this->assertCount(2, $foundFiles); - - $foundFileNames = []; - foreach ($foundFiles as $foundFile) { - $foundFileNames[] = $foundFile->getFilename(); - } - - $expectedFoundFileNames = ['some_config.yml', 'other_config.yaml']; - - sort($foundFileNames); - sort($expectedFoundFileNames); - $this->assertSame($expectedFoundFileNames, $foundFileNames); - } -} diff --git a/tests/FileSystem/FilesFinder/Source/SomeFile.php b/tests/FileSystem/FilesFinder/Source/SomeFile.php deleted file mode 100644 index 435724585b1..00000000000 --- a/tests/FileSystem/FilesFinder/Source/SomeFile.php +++ /dev/null @@ -1,3 +0,0 @@ - ------ - diff --git a/tests/Issues/CallableInterfaceDowngradeTest.php b/tests/Issues/CallableInterfaceDowngradeTest.php deleted file mode 100644 index a14f80765ff..00000000000 --- a/tests/Issues/CallableInterfaceDowngradeTest.php +++ /dev/null @@ -1,33 +0,0 @@ -doTestFileInfo($fileInfo); - } - - /** - * @return Iterator - */ - public function provideData(): Iterator - { - return $this->yieldFilesFromDirectory(__DIR__ . '/CallableFixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/callable_interface_downgrade.php'; - } -} diff --git a/tests/Issues/CovariantTrioTest.php b/tests/Issues/CovariantTrioTest.php deleted file mode 100644 index aba94aff6ef..00000000000 --- a/tests/Issues/CovariantTrioTest.php +++ /dev/null @@ -1,33 +0,0 @@ -doTestFileInfo($fileInfo); - } - - /** - * @return Iterator - */ - public function provideData(): Iterator - { - return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/covariant_trio.php'; - } -} diff --git a/tests/Issues/Fixture/coariant_mixture.php.inc b/tests/Issues/Fixture/coariant_mixture.php.inc deleted file mode 100644 index 3b0a7a1e159..00000000000 --- a/tests/Issues/Fixture/coariant_mixture.php.inc +++ /dev/null @@ -1,34 +0,0 @@ -getName()) { - } - } -} - -?> ------ -getName()) { - } - } -} - -?> diff --git a/tests/Issues/Fixture/input_interface.php.inc b/tests/Issues/Fixture/input_interface.php.inc deleted file mode 100644 index 2483b3de305..00000000000 --- a/tests/Issues/Fixture/input_interface.php.inc +++ /dev/null @@ -1,95 +0,0 @@ -getName()) { - } - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, bool $onlyParams = false) - { - } -} - -abstract class Input implements InputInterface -{ - -} - -class ArrayInput extends Input -{ - public function hasParameterOption($values, bool $onlyParams = false) - { - - } -} - -interface InputInterface -{ - public function hasParameterOption($values, bool $onlyParams = false); -} - -?> ------ -getName()) { - } - } - - /** - * {@inheritdoc} - * @param bool $onlyParams - */ - public function hasParameterOption($values, $onlyParams = false) - { - } -} - -abstract class Input implements InputInterface -{ - -} - -class ArrayInput extends Input -{ - /** - * @param bool $onlyParams - */ - public function hasParameterOption($values, $onlyParams = false) - { - - } -} - -interface InputInterface -{ - /** - * @param bool $onlyParams - */ - public function hasParameterOption($values, $onlyParams = false); -} - -?> diff --git a/tests/Issues/config/callable_interface_downgrade.php b/tests/Issues/config/callable_interface_downgrade.php deleted file mode 100644 index cd3a0ac370b..00000000000 --- a/tests/Issues/config/callable_interface_downgrade.php +++ /dev/null @@ -1,14 +0,0 @@ -import(DowngradeSetList::PHP_71); - $containerConfigurator->import(DowngradeSetList::PHP_72); - $containerConfigurator->import(DowngradeSetList::PHP_73); - $containerConfigurator->import(DowngradeSetList::PHP_74); - $containerConfigurator->import(DowngradeSetList::PHP_80); -}; diff --git a/tests/Issues/config/covariant_trio.php b/tests/Issues/config/covariant_trio.php deleted file mode 100644 index 6b09458785d..00000000000 --- a/tests/Issues/config/covariant_trio.php +++ /dev/null @@ -1,20 +0,0 @@ -parameters(); - $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_70); - - $services = $containerConfigurator->services(); - $services->set(DowngradeArrayKeyFirstLastRector::class); - $services->set(DowngradeScalarTypeDeclarationRector::class); - $services->set(DowngradeNullCoalesceRector::class); -}; diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/laravel.blade.php.inc b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/laravel.blade.php.inc deleted file mode 100644 index 350bb824d76..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/laravel.blade.php.inc +++ /dev/null @@ -1,13 +0,0 @@ -
- -
------ -
- -
diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/laravel_html_form_mix.blade.php.inc b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/laravel_html_form_mix.blade.php.inc deleted file mode 100644 index f90ba0d779d..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/laravel_html_form_mix.blade.php.inc +++ /dev/null @@ -1,17 +0,0 @@ -
- -
------ -
- -
diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/pre_slash_laravel.blade.php.inc b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/pre_slash_laravel.blade.php.inc deleted file mode 100644 index dbd0defbb5a..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/pre_slash_laravel.blade.php.inc +++ /dev/null @@ -1,3 +0,0 @@ -{if \Session::some()} ------ -{if \Illuminate\Support\Facades\Session::some()} diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_already_renamed.blade.php.inc b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_already_renamed.blade.php.inc deleted file mode 100644 index 5e0f12d69de..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_already_renamed.blade.php.inc +++ /dev/null @@ -1,8 +0,0 @@ -
- -
diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_dot_or_quote.php.inc b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_dot_or_quote.php.inc deleted file mode 100644 index b5321d30579..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_dot_or_quote.php.inc +++ /dev/null @@ -1,3 +0,0 @@ -'Session' - -Session.some diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_html_or_space.blade.php.inc b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_html_or_space.blade.php.inc deleted file mode 100644 index e8ca39b7a70..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_html_or_space.blade.php.inc +++ /dev/null @@ -1,3 +0,0 @@ -
Session
- -First Session diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_not_class_laravel.blade.php.inc b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_not_class_laravel.blade.php.inc deleted file mode 100644 index 7534e7478d3..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/blade-template/skip_not_class_laravel.blade.php.inc +++ /dev/null @@ -1,4 +0,0 @@ -
-
-
-
diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-neon/local_config.neon b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-neon/local_config.neon deleted file mode 100644 index fccc925fa14..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-neon/local_config.neon +++ /dev/null @@ -1,7 +0,0 @@ -services: - - - class: Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\OldClass ------ -services: - - - class: Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\NewClass diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-xml/local_config.xml b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-xml/local_config.xml deleted file mode 100644 index e9cbed58aa2..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-xml/local_config.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - ------ - - - diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-yaml/local_config.yaml b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-yaml/local_config.yaml deleted file mode 100644 index e3fdbba9a76..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-yaml/local_config.yaml +++ /dev/null @@ -1,5 +0,0 @@ -services: - Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\OldClass: null ------ -services: - Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\NewClass: null diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-yaml/local_config.yml b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-yaml/local_config.yml deleted file mode 100644 index e3fdbba9a76..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/config-yaml/local_config.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\OldClass: null ------ -services: - Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\NewClass: null diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/latte-template/dummy_template.latte b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/latte-template/dummy_template.latte deleted file mode 100644 index 95972902d33..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/latte-template/dummy_template.latte +++ /dev/null @@ -1,5 +0,0 @@ -{if \Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\OldClass::SOME_COSTANT === $value} -{/if} ------ -{if \Rector\Tests\Renaming\Rector\Name\RenameClassRector\Source\NewClass::SOME_COSTANT === $value} -{/if} diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/twig-template/dummy_template.twig b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/twig-template/dummy_template.twig deleted file mode 100644 index 0697998829a..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/Fixture/twig-template/dummy_template.twig +++ /dev/null @@ -1,3 +0,0 @@ -{{ constant('Rector\\Tests\\Renaming\\Rector\\Name\\RenameClassRector\\Source\\OldClass::SOME_COSTANT') }} ------ -{{ constant('Rector\\Tests\\Renaming\\Rector\\Name\\RenameClassRector\\Source\\NewClass::SOME_COSTANT') }} diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/RenameClassNonPhpRectorTest.php b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/RenameClassNonPhpRectorTest.php deleted file mode 100644 index 3e6b83ff0af..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/RenameClassNonPhpRectorTest.php +++ /dev/null @@ -1,34 +0,0 @@ -doTestFileInfo($fixtureFileInfo); - } - - /** - * @return Iterator> - */ - public function provideData(): Iterator - { - return StaticFixtureFinder::yieldDirectory(__DIR__ . '/Fixture', '*'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/configured_rule.php'; - } -} diff --git a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/config/configured_rule.php b/tests/NonPhpFile/Rector/RenameClassNonPhpRector/config/configured_rule.php deleted file mode 100644 index 04d1f4cd2ba..00000000000 --- a/tests/NonPhpFile/Rector/RenameClassNonPhpRector/config/configured_rule.php +++ /dev/null @@ -1,24 +0,0 @@ -services(); - - $services->set(RenameClassNonPhpRector::class) - ->call('configure', [[ - RenameClassNonPhpRector::RENAME_CLASSES => [ - 'Session' => 'Illuminate\Support\Facades\Session', - OldClass::class => NewClass::class, - // Laravel - 'Form' => 'Collective\Html\FormFacade', - 'Html' => 'Collective\Html\HtmlFacade', - ], - ], - ]); -}; diff --git a/tests/Php/PhpVersionProviderTest.php b/tests/Php/PhpVersionProviderTest.php deleted file mode 100644 index 0dde5f1b6f4..00000000000 --- a/tests/Php/PhpVersionProviderTest.php +++ /dev/null @@ -1,28 +0,0 @@ -boot(); - $this->phpVersionProvider = $this->getService(PhpVersionProvider::class); - } - - public function test(): void - { - $phpVersion = $this->phpVersionProvider->provide(); - $this->assertSame(100000, $phpVersion); - } -} diff --git a/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/Fixture/some_composer.json b/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/Fixture/some_composer.json deleted file mode 100644 index 6e2cbb5525f..00000000000 --- a/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/Fixture/some_composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "php": ">=7.3" - } -} diff --git a/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/Fixture/some_composer_with_platform.json b/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/Fixture/some_composer_with_platform.json deleted file mode 100644 index 69651895768..00000000000 --- a/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/Fixture/some_composer_with_platform.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": { - "php": ">=7.3" - }, - "config": { - "platform": { - "php": "7.4" - } - } -} diff --git a/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/ProjectComposerJsonPhpVersionResolverTest.php b/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/ProjectComposerJsonPhpVersionResolverTest.php deleted file mode 100644 index 9c45a3109af..00000000000 --- a/tests/Php/PhpVersionResolver/ProjectComposerJsonPhpVersionResolver/ProjectComposerJsonPhpVersionResolverTest.php +++ /dev/null @@ -1,41 +0,0 @@ -boot(); - $this->projectComposerJsonPhpVersionResolver = $this->getService(ProjectComposerJsonPhpVersionResolver::class); - } - - /** - * @dataProvider provideData() - */ - public function test(string $composerJsonFilePath, int $expectedPhpVersion): void - { - $resolvePhpVersion = $this->projectComposerJsonPhpVersionResolver->resolve($composerJsonFilePath); - $this->assertSame($expectedPhpVersion, $resolvePhpVersion); - } - - /** - * @return Iterator> - */ - public function provideData(): Iterator - { - yield [__DIR__ . '/Fixture/some_composer.json', 70300]; - yield [__DIR__ . '/Fixture/some_composer_with_platform.json', 70400]; - } -} diff --git a/tests/PhpParser/Node/BetterNodeFinder/BetterNodeFinderTest.php b/tests/PhpParser/Node/BetterNodeFinder/BetterNodeFinderTest.php deleted file mode 100644 index 899311888ae..00000000000 --- a/tests/PhpParser/Node/BetterNodeFinder/BetterNodeFinderTest.php +++ /dev/null @@ -1,62 +0,0 @@ -boot(); - - $this->betterNodeFinder = $this->getService(BetterNodeFinder::class); - - /** @var SimplePhpParser $simplePhpParser */ - $simplePhpParser = $this->getService(SimplePhpParser::class); - $this->nodes = $simplePhpParser->parseFile(__DIR__ . '/Source/SomeFile.php.inc'); - } - - public function testFindFirstAncestorInstanceOf(): void - { - $variable = $this->betterNodeFinder->findFirstInstanceOf($this->nodes, Variable::class); - $class = $this->betterNodeFinder->findFirstInstanceOf($this->nodes, Class_::class); - - $this->assertNotNull($variable); - $this->assertNotNull($class); - - $this->assertInstanceOf(Variable::class, $variable); - $this->assertInstanceOf(Class_::class, $class); - - /** @var Variable $variable */ - $classLikeNode = $this->betterNodeFinder->findParentType($variable, ClassLike::class); - $this->assertSame($classLikeNode, $class); - } - - public function testFindMissingFirstAncestorInstanceOf(): void - { - /** @var Variable $variableNode */ - $variableNode = $this->betterNodeFinder->findFirstInstanceOf($this->nodes, Variable::class); - - $this->assertNull($this->betterNodeFinder->findParentType($variableNode, Array_::class)); - } -} diff --git a/tests/PhpParser/Node/BetterNodeFinder/Source/SomeFile.php.inc b/tests/PhpParser/Node/BetterNodeFinder/Source/SomeFile.php.inc deleted file mode 100644 index 0bedebbf86f..00000000000 --- a/tests/PhpParser/Node/BetterNodeFinder/Source/SomeFile.php.inc +++ /dev/null @@ -1,9 +0,0 @@ -boot(); - - $this->nodeFactory = $this->getService(NodeFactory::class); - } - - /** - * @param int[]|array $inputArray - * @dataProvider provideDataForArray() - */ - public function testCreateArray(array $inputArray, Array_ $expectedArrayNode): void - { - $arrayNode = $this->nodeFactory->createArray($inputArray); - - $this->assertEquals($expectedArrayNode, $arrayNode); - } - - /** - * @return Iterator|Array_[]> - */ - public function provideDataForArray(): Iterator - { - $array = new Array_(); - $array->items[] = new ArrayItem(new LNumber(1)); - - yield [[1], $array]; - - $array = new Array_(); - $array->items[] = new ArrayItem(new LNumber(1), new String_('a')); - - yield [[ - 'a' => 1, - ], $array]; - } -} diff --git a/tests/PhpParser/Node/Value/ValueResolverTest.php b/tests/PhpParser/Node/Value/ValueResolverTest.php deleted file mode 100644 index 9eebcf71b88..00000000000 --- a/tests/PhpParser/Node/Value/ValueResolverTest.php +++ /dev/null @@ -1,60 +0,0 @@ -boot(); - $this->valueResolver = $this->getService(ValueResolver::class); - } - - /** - * @param mixed $expectedValue - * @dataProvider dataProvider - */ - public function test(Expr $expr, $expectedValue): void - { - $resolvedValue = $this->valueResolver->getValue($expr); - $this->assertSame($expectedValue, $resolvedValue); - } - - /** - * @return Iterator> - */ - public function dataProvider(): Iterator - { - $builderFactory = new BuilderFactory(); - - $classConstFetchNode = $builderFactory->classConstFetch('SomeClass', 'SOME_CONSTANT'); - $classConstFetchNode->class->setAttribute( - AttributeKey::RESOLVED_NAME, - new FullyQualified('SomeClassResolveName') - ); - - yield [$classConstFetchNode, 'SomeClassResolveName::SOME_CONSTANT']; - yield [$builderFactory->val(true), true]; - yield [$builderFactory->val(1), 1]; - yield [$builderFactory->val(1.0), 1.0]; - yield [$builderFactory->var('foo'), null]; - yield [new Plus($builderFactory->val(1), $builderFactory->val(1)), 2]; - yield [new Plus($builderFactory->val(1), $builderFactory->var('foo')), null]; - } -} diff --git a/tests/PhpParser/Printer/BetterStandardPrinterTest.php b/tests/PhpParser/Printer/BetterStandardPrinterTest.php deleted file mode 100644 index f72284d464a..00000000000 --- a/tests/PhpParser/Printer/BetterStandardPrinterTest.php +++ /dev/null @@ -1,95 +0,0 @@ -boot(); - $this->betterStandardPrinter = $this->getService(BetterStandardPrinter::class); - } - - public function testAddingCommentOnSomeNodesFail(): void - { - $methodCall = new MethodCall(new Variable('this'), 'run'); - - // cannot be on MethodCall, must be Expression - $methodCallExpression = new Expression($methodCall); - $methodCallExpression->setAttribute(AttributeKey::COMMENTS, [new Comment('// todo: fix')]); - - $methodBuilder = new MethodBuilder('run'); - $methodBuilder->addStmt($methodCallExpression); - - $classMethod = $methodBuilder->getNode(); - - $printed = $this->betterStandardPrinter->print($classMethod) . PHP_EOL; - $this->assertStringEqualsFile( - __DIR__ . '/Source/expected_code_with_non_stmt_placed_nested_comment.php.inc', - $printed - ); - } - - public function testStringWithAddedComment(): void - { - $string = new String_('hey'); - $string->setAttribute(AttributeKey::COMMENTS, [new Comment('// todo: fix')]); - - $printed = $this->betterStandardPrinter->print($string) . PHP_EOL; - $this->assertStringEqualsFile(__DIR__ . '/Source/expected_code_with_comment.php.inc', $printed); - } - - /** - * @dataProvider provideDataForDoubleSlashEscaping() - */ - public function testDoubleSlashEscaping(string $content, string $expectedOutput): void - { - $printed = $this->betterStandardPrinter->print(new String_($content)); - $this->assertSame($expectedOutput, $printed); - } - - /** - * @return Iterator - */ - public function provideDataForDoubleSlashEscaping(): Iterator - { - yield ['Vendor\Name', "'Vendor\Name'"]; - yield ['Vendor\\', "'Vendor\\\\'"]; - yield ["Vendor'Name", "'Vendor\'Name'"]; - } - - public function testYield(): void - { - $yield = new Yield_(new String_('value')); - - $printed = $this->betterStandardPrinter->print($yield); - $this->assertSame("(yield 'value')", $printed); - - $printed = $this->betterStandardPrinter->print(new Yield_()); - $this->assertSame('yield', $printed); - - $expression = new Expression($yield); - $yield->setAttribute(AttributeKey::PARENT_NODE, $expression); - $printed = $this->betterStandardPrinter->print($expression); - $this->assertSame("yield 'value';", $printed); - } -} diff --git a/tests/PhpParser/Printer/CommentPreserving/CommentPreservingTest.php b/tests/PhpParser/Printer/CommentPreserving/CommentPreservingTest.php deleted file mode 100644 index c4eb09858c3..00000000000 --- a/tests/PhpParser/Printer/CommentPreserving/CommentPreservingTest.php +++ /dev/null @@ -1,33 +0,0 @@ -doTestFileInfo($fileInfo); - } - - /** - * @return Iterator - */ - public function provideData(): Iterator - { - return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/configured_rule.php'; - } -} diff --git a/tests/PhpParser/Printer/CommentPreserving/Fixture/comments_for_typed_property.php.inc b/tests/PhpParser/Printer/CommentPreserving/Fixture/comments_for_typed_property.php.inc deleted file mode 100644 index edf1be4d3e6..00000000000 --- a/tests/PhpParser/Printer/CommentPreserving/Fixture/comments_for_typed_property.php.inc +++ /dev/null @@ -1,75 +0,0 @@ -eventDispatcher = $eventDispatcher; - } -} - -?> ------ -eventDispatcher = $eventDispatcher; - } -} - -?> diff --git a/tests/PhpParser/Printer/CommentPreserving/Fixture/keep_comment.php.inc b/tests/PhpParser/Printer/CommentPreserving/Fixture/keep_comment.php.inc deleted file mode 100644 index 53bf4e91c07..00000000000 --- a/tests/PhpParser/Printer/CommentPreserving/Fixture/keep_comment.php.inc +++ /dev/null @@ -1,19 +0,0 @@ -services(); - $services->set(TypedPropertyRector::class); -}; diff --git a/tests/PhpParser/Printer/FormatPerservingPrinterTest.php b/tests/PhpParser/Printer/FormatPerservingPrinterTest.php deleted file mode 100644 index c1151121b59..00000000000 --- a/tests/PhpParser/Printer/FormatPerservingPrinterTest.php +++ /dev/null @@ -1,53 +0,0 @@ -boot(); - $this->formatPerservingPrinter = $this->getService(FormatPerservingPrinter::class); - $this->smartFileSystem = $this->getService(SmartFileSystem::class); - } - - protected function tearDown(): void - { - $this->smartFileSystem->remove(__DIR__ . '/Fixture'); - } - - public function testFileModeIsPreserved(): void - { - mkdir(__DIR__ . '/Fixture'); - touch(__DIR__ . '/Fixture/file.php'); - - chmod(__DIR__ . '/Fixture/file.php', self::EXPECTED_FILEMOD); - - $fileInfo = new SmartFileInfo(__DIR__ . '/Fixture/file.php'); - $this->formatPerservingPrinter->printToFile($fileInfo, [], [], []); - - $this->assertSame(self::EXPECTED_FILEMOD, fileperms(__DIR__ . '/Fixture/file.php') & 0777); - } -} diff --git a/tests/PhpParser/Printer/Source/expected_code_with_comment.php.inc b/tests/PhpParser/Printer/Source/expected_code_with_comment.php.inc deleted file mode 100644 index 2b5a6e45a8e..00000000000 --- a/tests/PhpParser/Printer/Source/expected_code_with_comment.php.inc +++ /dev/null @@ -1,2 +0,0 @@ -// todo: fix -'hey' diff --git a/tests/PhpParser/Printer/Source/expected_code_with_non_stmt_placed_nested_comment.php.inc b/tests/PhpParser/Printer/Source/expected_code_with_non_stmt_placed_nested_comment.php.inc deleted file mode 100644 index 7f934dc3025..00000000000 --- a/tests/PhpParser/Printer/Source/expected_code_with_non_stmt_placed_nested_comment.php.inc +++ /dev/null @@ -1,5 +0,0 @@ -function run() -{ - // todo: fix - $this->run(); -} diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 932a0d70f00..00000000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,20 +0,0 @@ -loadStubs(); diff --git a/tests/debug_functions.php b/tests/debug_functions.php deleted file mode 100644 index 671cfa82af9..00000000000 --- a/tests/debug_functions.php +++ /dev/null @@ -1,26 +0,0 @@ -prettyPrint([$singleNode]); - dump($printedContent); - } - } else { - $printedContent = $standard->prettyPrint([$node]); - dump($printedContent); - } -} diff --git a/tests/fixture-finalize/SkipSomeEntity.php b/tests/fixture-finalize/SkipSomeEntity.php deleted file mode 100644 index ee06f874e0e..00000000000 --- a/tests/fixture-finalize/SkipSomeEntity.php +++ /dev/null @@ -1,14 +0,0 @@ -