diff --git a/tests/Issues/Issue2863/Fixture/fixture2863_keep_comment.php.inc b/tests/Issues/Issue2863/Fixture/fixture2863_keep_comment.php.inc deleted file mode 100644 index fe2bbbd2db6..00000000000 --- a/tests/Issues/Issue2863/Fixture/fixture2863_keep_comment.php.inc +++ /dev/null @@ -1,12 +0,0 @@ -eventDispatcher = $eventDispatcher; - } -} - -?> ------ -eventDispatcher = $eventDispatcher; - } -} - -?> diff --git a/tests/Issues/Issue3222/Fixture/fixture3222_with_many_comments.php.inc b/tests/Issues/Issue3222/Fixture/fixture3222_with_many_comments.php.inc deleted file mode 100644 index 49d68f6eebb..00000000000 --- a/tests/Issues/Issue3222/Fixture/fixture3222_with_many_comments.php.inc +++ /dev/null @@ -1,63 +0,0 @@ -eventDispatcher = $eventDispatcher; - } -} - -?> ------ -eventDispatcher = $eventDispatcher; - } -} - -?> diff --git a/tests/Issues/Issue3222/Issue3222Test.php b/tests/Issues/Issue3222/Issue3222Test.php deleted file mode 100644 index e0f80751015..00000000000 --- a/tests/Issues/Issue3222/Issue3222Test.php +++ /dev/null @@ -1,30 +0,0 @@ -doTestFileInfo($fileInfo); - } - - public function provideData(): Iterator - { - return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - protected function provideConfig(): string - { - return __DIR__ . '/config3222.yaml'; - } -} diff --git a/tests/Issues/Issue3222/config3222.yaml b/tests/Issues/Issue3222/config3222.yaml deleted file mode 100644 index c3ce0f278c8..00000000000 --- a/tests/Issues/Issue3222/config3222.yaml +++ /dev/null @@ -1,2 +0,0 @@ -services: - Rector\Php74\Rector\Property\TypedPropertyRector: null diff --git a/tests/Issues/Issue2863/Issue2863Test.php b/tests/PhpParser/Printer/CommentPreserving/CommentPreservingTest.php similarity index 62% rename from tests/Issues/Issue2863/Issue2863Test.php rename to tests/PhpParser/Printer/CommentPreserving/CommentPreservingTest.php index 6f9ac11d6ca..f489bf8072a 100644 --- a/tests/Issues/Issue2863/Issue2863Test.php +++ b/tests/PhpParser/Printer/CommentPreserving/CommentPreservingTest.php @@ -2,13 +2,14 @@ declare(strict_types=1); -namespace Rector\Core\Tests\Issues\Issue2863; +namespace Rector\Core\Tests\PhpParser\Printer\CommentPreserving; use Iterator; use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase; +use Rector\Php74\Rector\Property\TypedPropertyRector; use Symplify\SmartFileSystem\SmartFileInfo; -final class Issue2863Test extends AbstractRectorTestCase +final class CommentPreservingTest extends AbstractRectorTestCase { /** * @dataProvider provideData() @@ -23,8 +24,8 @@ final class Issue2863Test extends AbstractRectorTestCase return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); } - protected function provideConfig(): string + protected function getRectorClass(): string { - return __DIR__ . '/config2863.yaml'; + return TypedPropertyRector::class; } } 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 new file mode 100644 index 00000000000..edf1be4d3e6 --- /dev/null +++ b/tests/PhpParser/Printer/CommentPreserving/Fixture/comments_for_typed_property.php.inc @@ -0,0 +1,75 @@ +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 new file mode 100644 index 00000000000..53bf4e91c07 --- /dev/null +++ b/tests/PhpParser/Printer/CommentPreserving/Fixture/keep_comment.php.inc @@ -0,0 +1,19 @@ +