From 4974c1d1394cb960c396bd4da8474ffc2116b402 Mon Sep 17 00:00:00 2001 From: Stefan Blanke Date: Wed, 4 Mar 2020 13:46:36 +0100 Subject: [PATCH 1/3] Add failing tests for method annotation --- .../fixture_with_template_annotation.php.inc | 42 +++++++++++++++++++ .../fixture_with_template_annotation2.php.inc | 42 +++++++++++++++++++ ...dAnnotationToRouteAnnotationRectorTest.php | 2 + 3 files changed, 86 insertions(+) create mode 100755 packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc create mode 100755 packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc diff --git a/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc new file mode 100755 index 000000000000..1259083e646e --- /dev/null +++ b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc @@ -0,0 +1,42 @@ + +----- + diff --git a/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc new file mode 100755 index 000000000000..28b03e9c93cf --- /dev/null +++ b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc @@ -0,0 +1,42 @@ + +----- + diff --git a/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php index aff8e5892f45..156b0bae2c44 100644 --- a/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php +++ b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php @@ -21,6 +21,8 @@ public function test(string $file): void public function provideDataForTest(): Iterator { yield [__DIR__ . '/Fixture/fixture.php.inc']; + yield [__DIR__ . '/Fixture/fixture_with_template_annotation.php.inc']; + yield [__DIR__ . '/Fixture/fixture_with_template_annotation2.php.inc']; } protected function getRectorClass(): string From 9f7ba49b991a1dbd3e69b4766b40d36ebd567f8c Mon Sep 17 00:00:00 2001 From: Stefan Blanke Date: Wed, 4 Mar 2020 13:55:44 +0100 Subject: [PATCH 2/3] Resolve conflict --- ...ergeMethodAnnotationToRouteAnnotationRectorTest.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php index 156b0bae2c44..a2484f0db74b 100644 --- a/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php +++ b/packages/Symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php @@ -5,24 +5,22 @@ namespace Rector\Symfony\Tests\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector; use Iterator; +use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase; use Rector\Symfony\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector; -use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class MergeMethodAnnotationToRouteAnnotationRectorTest extends AbstractRectorTestCase { /** - * @dataProvider provideDataForTest() + * @dataProvider provideData() */ public function test(string $file): void { $this->doTestFile($file); } - public function provideDataForTest(): Iterator + public function provideData(): Iterator { - yield [__DIR__ . '/Fixture/fixture.php.inc']; - yield [__DIR__ . '/Fixture/fixture_with_template_annotation.php.inc']; - yield [__DIR__ . '/Fixture/fixture_with_template_annotation2.php.inc']; + return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); } protected function getRectorClass(): string From 19d18c5a6a79fd705d03b4302a06dd817281dbb9 Mon Sep 17 00:00:00 2001 From: Stefan Blanke Date: Wed, 4 Mar 2020 14:54:21 +0100 Subject: [PATCH 3/3] Add two failings tests --- .../fixture_with_template_annotation.php.inc | 42 +++++++++++++++++++ .../fixture_with_template_annotation2.php.inc | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100755 rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc create mode 100755 rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc diff --git a/rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc b/rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc new file mode 100755 index 000000000000..1259083e646e --- /dev/null +++ b/rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation.php.inc @@ -0,0 +1,42 @@ + +----- + diff --git a/rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc b/rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc new file mode 100755 index 000000000000..28b03e9c93cf --- /dev/null +++ b/rules/symfony/tests/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/Fixture/fixture_with_template_annotation2.php.inc @@ -0,0 +1,42 @@ + +----- +