diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 0307993e0b5..1713ebf674e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -26,25 +26,15 @@ jobs: directory: - 'e2e/applied-auto-import' - 'e2e/applied-polyfill-php80' - - 'e2e/applied-rule-change-docblock' - - 'e2e/applied-rule-removed-node' - - 'e2e/applied-rule-return-array-nodes' - 'e2e/config-dist-fallback' - 'e2e/config-file-priority' - - 'e2e/different-path-over-skip-config' - - 'e2e/invalid-paths' - - 'e2e/no-parallel-reflection-resolver' - 'e2e/only-option' - - 'e2e/only-option-quote-double-equalnone' - - 'e2e/only-option-quote-single' - - 'e2e/only-option-quote-single-bsdouble' - - 'e2e/only-option-quote-single-equalnone' - 'e2e/parallel-custom-config' - 'e2e/parallel-unused-skips' - 'e2e/parallel-reflection-resolver' - 'e2e/parallel with space' - - 'e2e/print-new-node' - 'e2e/phpstan-container-bootstrap' + - 'e2e/rules-summary-option' name: End to end test - ${{ matrix.directory }} @@ -82,3 +72,13 @@ jobs: - run: php ../e2eTestRunner.php working-directory: ${{ matrix.directory }} if: ${{ matrix.directory != 'e2e/parallel-custom-config' && matrix.directory != 'e2e/parallel-unused-skips' }} + + # the "--only" option must handle any shell quoting of the very same rule class + - + working-directory: ${{ matrix.directory }} + if: ${{ matrix.directory == 'e2e/only-option' }} + run: | + php ../e2eTestRunner.php --cli-options cli-options-quote-single.txt + php ../e2eTestRunner.php --cli-options cli-options-quote-single-bsdouble.txt + php ../e2eTestRunner.php --cli-options cli-options-quote-single-equalnone.txt + php ../e2eTestRunner.php --cli-options cli-options-quote-double-equalnone.txt diff --git a/composer.json b/composer.json index dd8901d5d78..4213c34423b 100644 --- a/composer.json +++ b/composer.json @@ -84,10 +84,7 @@ "tests" ], "Rector\\Utils\\PHPStan\\Tests\\": "utils/phpstan/tests", - "E2e\\Parallel\\Reflection\\Resolver\\": [ - "e2e/parallel-reflection-resolver/src/", - "e2e/no-parallel-reflection-resolver/src" - ], + "E2e\\Parallel\\Reflection\\Resolver\\": "e2e/parallel-reflection-resolver/src/", "Rector\\Scripts\\": "scripts/src" }, "classmap": [ diff --git a/e2e/applied-rule-change-docblock/.gitignore b/e2e/applied-rule-change-docblock/.gitignore deleted file mode 100644 index 61ead86667c..00000000000 --- a/e2e/applied-rule-change-docblock/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/vendor diff --git a/e2e/applied-rule-change-docblock/composer.json b/e2e/applied-rule-change-docblock/composer.json deleted file mode 100644 index 5468cd74606..00000000000 --- a/e2e/applied-rule-change-docblock/composer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "require": { - "php": "^8.1" - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/e2e/applied-rule-change-docblock/expected-output.diff b/e2e/applied-rule-change-docblock/expected-output.diff deleted file mode 100644 index 3acf9cf9ac2..00000000000 --- a/e2e/applied-rule-change-docblock/expected-output.diff +++ /dev/null @@ -1,40 +0,0 @@ -2 files with changes -==================== - -1) src/RenameDocblock.php:1 - - ---------- begin diff ---------- -@@ Line 1 @@ - paths([ - __DIR__ . '/src', - ]); - - $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ - 'DateTime' => 'DateTimeInterface' - ]); - $rectorConfig->ruleWithConfiguration(DowngradeAttributeToAnnotationRector::class, [ - new DowngradeAttributeToAnnotation('Symfony\Component\Routing\Annotation\Route') - ]); - - $rectorConfig->rule(RemoveUselessVarTagRector::class); -}; diff --git a/e2e/applied-rule-change-docblock/src/AlreadyChangedDocblock.php b/e2e/applied-rule-change-docblock/src/AlreadyChangedDocblock.php deleted file mode 100644 index 3c839fbfa12..00000000000 --- a/e2e/applied-rule-change-docblock/src/AlreadyChangedDocblock.php +++ /dev/null @@ -1,8 +0,0 @@ -paths([ - __DIR__ . '/src', - ]); - - $rectorConfig->rule(RemoveEmptyClassMethodRector::class); - $rectorConfig->rule(RemoveAlwaysTrueIfConditionRector::class); -}; diff --git a/e2e/applied-rule-removed-node/src/AlwaysTrue.php b/e2e/applied-rule-removed-node/src/AlwaysTrue.php deleted file mode 100644 index 7b70b9e9ccd..00000000000 --- a/e2e/applied-rule-removed-node/src/AlwaysTrue.php +++ /dev/null @@ -1,12 +0,0 @@ -paths([ - __DIR__ . '/src', - ]); - - $rectorConfig->rules([ - RemoveAlwaysElseRector::class, - RemoveUnusedPrivateMethodRector::class, - ]); -}; - diff --git a/e2e/applied-rule-return-array-nodes/src/MultiRules.php b/e2e/applied-rule-return-array-nodes/src/MultiRules.php deleted file mode 100644 index fc0db50a1fb..00000000000 --- a/e2e/applied-rule-return-array-nodes/src/MultiRules.php +++ /dev/null @@ -1,17 +0,0 @@ -paths([ - __DIR__ . '/src', - ]); - - $rectorConfig->skip([ - RemoveEmptyClassMethodRector::class => [ - __DIR__ . '/src/controllers', - ], - ]); - - $rectorConfig->rule(RemoveEmptyClassMethodRector::class); -}; diff --git a/e2e/different-path-over-skip-config/src/controllers/DeadConstructor.php b/e2e/different-path-over-skip-config/src/controllers/DeadConstructor.php deleted file mode 100644 index 5d1dd2c8144..00000000000 --- a/e2e/different-path-over-skip-config/src/controllers/DeadConstructor.php +++ /dev/null @@ -1,10 +0,0 @@ -disableParallel(); - - $rectorConfig->paths([ - __DIR__ . '/src/', // correct path - __DIR__ . '/does-not-exist/' - ]); -}; diff --git a/e2e/invalid-paths/src/NamespacedSomeClassFound.php b/e2e/invalid-paths/src/NamespacedSomeClassFound.php deleted file mode 100644 index 0fc6a46b185..00000000000 --- a/e2e/invalid-paths/src/NamespacedSomeClassFound.php +++ /dev/null @@ -1,10 +0,0 @@ -disableParallel(); - - $rectorConfig->paths([ - __DIR__ . '/src/', - ]); - - $rectorConfig->rule(RemoveUnusedPrivatePropertyRector::class); -}; diff --git a/e2e/no-parallel-reflection-resolver/src/NamespacedSomeClassFound.php b/e2e/no-parallel-reflection-resolver/src/NamespacedSomeClassFound.php deleted file mode 100644 index 0fc6a46b185..00000000000 --- a/e2e/no-parallel-reflection-resolver/src/NamespacedSomeClassFound.php +++ /dev/null @@ -1,10 +0,0 @@ -paths([ - __DIR__ . '/../only-option/src', - ]); - - $rectorConfig->rules([ - RemoveAlwaysElseRector::class, - RemoveUnusedPrivateMethodRector::class, - ]); -}; diff --git a/e2e/only-option-quote-single-bsdouble/composer.json b/e2e/only-option-quote-single-bsdouble/composer.json deleted file mode 100644 index 5468cd74606..00000000000 --- a/e2e/only-option-quote-single-bsdouble/composer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "require": { - "php": "^8.1" - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/e2e/only-option-quote-single-bsdouble/expected-output.diff b/e2e/only-option-quote-single-bsdouble/expected-output.diff deleted file mode 100644 index 6c525ad985f..00000000000 --- a/e2e/only-option-quote-single-bsdouble/expected-output.diff +++ /dev/null @@ -1,22 +0,0 @@ -1 file with changes -=================== - -1) ../only-option/src/MultiRules.php:10 - - ---------- begin diff ---------- -@@ Line 10 @@ - echo 'a statement'; - } - } -- -- private function notUsed() -- { -- } - } - ----------- end diff ----------- - -Applied rules: - * RemoveUnusedPrivateMethodRector - - - [OK] 1 file would have been changed (dry-run) by Rector diff --git a/e2e/only-option-quote-single-bsdouble/rector.php b/e2e/only-option-quote-single-bsdouble/rector.php deleted file mode 100644 index ad19381b8b4..00000000000 --- a/e2e/only-option-quote-single-bsdouble/rector.php +++ /dev/null @@ -1,18 +0,0 @@ -paths([ - __DIR__ . '/../only-option/src', - ]); - - $rectorConfig->rules([ - RemoveAlwaysElseRector::class, - RemoveUnusedPrivateMethodRector::class, - ]); -}; diff --git a/e2e/only-option-quote-single-equalnone/composer.json b/e2e/only-option-quote-single-equalnone/composer.json deleted file mode 100644 index 5468cd74606..00000000000 --- a/e2e/only-option-quote-single-equalnone/composer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "require": { - "php": "^8.1" - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/e2e/only-option-quote-single-equalnone/expected-output.diff b/e2e/only-option-quote-single-equalnone/expected-output.diff deleted file mode 100644 index 6c525ad985f..00000000000 --- a/e2e/only-option-quote-single-equalnone/expected-output.diff +++ /dev/null @@ -1,22 +0,0 @@ -1 file with changes -=================== - -1) ../only-option/src/MultiRules.php:10 - - ---------- begin diff ---------- -@@ Line 10 @@ - echo 'a statement'; - } - } -- -- private function notUsed() -- { -- } - } - ----------- end diff ----------- - -Applied rules: - * RemoveUnusedPrivateMethodRector - - - [OK] 1 file would have been changed (dry-run) by Rector diff --git a/e2e/only-option-quote-single-equalnone/rector.php b/e2e/only-option-quote-single-equalnone/rector.php deleted file mode 100644 index ad19381b8b4..00000000000 --- a/e2e/only-option-quote-single-equalnone/rector.php +++ /dev/null @@ -1,18 +0,0 @@ -paths([ - __DIR__ . '/../only-option/src', - ]); - - $rectorConfig->rules([ - RemoveAlwaysElseRector::class, - RemoveUnusedPrivateMethodRector::class, - ]); -}; diff --git a/e2e/only-option-quote-single/composer.json b/e2e/only-option-quote-single/composer.json deleted file mode 100644 index 5468cd74606..00000000000 --- a/e2e/only-option-quote-single/composer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "require": { - "php": "^8.1" - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/e2e/only-option-quote-single/expected-output.diff b/e2e/only-option-quote-single/expected-output.diff deleted file mode 100644 index 6c525ad985f..00000000000 --- a/e2e/only-option-quote-single/expected-output.diff +++ /dev/null @@ -1,22 +0,0 @@ -1 file with changes -=================== - -1) ../only-option/src/MultiRules.php:10 - - ---------- begin diff ---------- -@@ Line 10 @@ - echo 'a statement'; - } - } -- -- private function notUsed() -- { -- } - } - ----------- end diff ----------- - -Applied rules: - * RemoveUnusedPrivateMethodRector - - - [OK] 1 file would have been changed (dry-run) by Rector diff --git a/e2e/only-option-quote-single/rector.php b/e2e/only-option-quote-single/rector.php deleted file mode 100644 index ad19381b8b4..00000000000 --- a/e2e/only-option-quote-single/rector.php +++ /dev/null @@ -1,18 +0,0 @@ -paths([ - __DIR__ . '/../only-option/src', - ]); - - $rectorConfig->rules([ - RemoveAlwaysElseRector::class, - RemoveUnusedPrivateMethodRector::class, - ]); -}; diff --git a/e2e/only-option-quote-double-equalnone/cli-options.txt b/e2e/only-option/cli-options-quote-double-equalnone.txt similarity index 100% rename from e2e/only-option-quote-double-equalnone/cli-options.txt rename to e2e/only-option/cli-options-quote-double-equalnone.txt diff --git a/e2e/only-option-quote-single-bsdouble/cli-options.txt b/e2e/only-option/cli-options-quote-single-bsdouble.txt similarity index 100% rename from e2e/only-option-quote-single-bsdouble/cli-options.txt rename to e2e/only-option/cli-options-quote-single-bsdouble.txt diff --git a/e2e/only-option-quote-single-equalnone/cli-options.txt b/e2e/only-option/cli-options-quote-single-equalnone.txt similarity index 100% rename from e2e/only-option-quote-single-equalnone/cli-options.txt rename to e2e/only-option/cli-options-quote-single-equalnone.txt diff --git a/e2e/only-option-quote-single/cli-options.txt b/e2e/only-option/cli-options-quote-single.txt similarity index 100% rename from e2e/only-option-quote-single/cli-options.txt rename to e2e/only-option/cli-options-quote-single.txt diff --git a/e2e/print-new-node/.gitignore b/e2e/print-new-node/.gitignore deleted file mode 100644 index 61ead86667c..00000000000 --- a/e2e/print-new-node/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/vendor diff --git a/e2e/print-new-node/composer.json b/e2e/print-new-node/composer.json deleted file mode 100644 index 8b5ca727be7..00000000000 --- a/e2e/print-new-node/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "php": "^8.1" - } -} diff --git a/e2e/print-new-node/expected-output.diff b/e2e/print-new-node/expected-output.diff deleted file mode 100644 index 7423bc78f19..00000000000 --- a/e2e/print-new-node/expected-output.diff +++ /dev/null @@ -1,22 +0,0 @@ -1 file with changes -=================== - -1) src/ExtendingTestClass.php:1 - - ---------- begin diff ---------- -@@ Line 1 @@ - paths([ - __DIR__ . '/src/TestClass.php', - __DIR__ . '/src/ExtendingTestClass.php', - ]); - - $rectorConfig->rule(AddParamBasedOnParentClassMethodRector::class); -}; \ No newline at end of file diff --git a/e2e/print-new-node/src/ExtendingTestClass.php b/e2e/print-new-node/src/ExtendingTestClass.php deleted file mode 100644 index cef467fb61f..00000000000 --- a/e2e/print-new-node/src/ExtendingTestClass.php +++ /dev/null @@ -1,7 +0,0 @@ -