From 604ba968a3cad4dc8d5239320273aa85ed132cc1 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 28 Dec 2022 14:00:31 -0500 Subject: [PATCH 1/2] [make:authenticator] doctrine/annotations not needed in tests --- tests/Maker/MakeAuthenticatorTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Maker/MakeAuthenticatorTest.php b/tests/Maker/MakeAuthenticatorTest.php index e94baed3c..1dc3adf19 100644 --- a/tests/Maker/MakeAuthenticatorTest.php +++ b/tests/Maker/MakeAuthenticatorTest.php @@ -164,7 +164,7 @@ public function getTestDetails(): \Generator ]; yield 'auth_login_form_no_entity_custom_username_field' => [$this->createMakerTest() - ->addExtraDependencies('doctrine/annotations', 'twig', 'symfony/form') + ->addExtraDependencies('twig', 'symfony/form') ->run(function (MakerTestRunner $runner) { $this->makeUser($runner, 'userEmail', false); @@ -193,7 +193,7 @@ public function getTestDetails(): \Generator ]; yield 'auth_login_form_user_not_entity_with_hasher' => [$this->createMakerTest() - ->addExtraDependencies('doctrine/annotations', 'twig', 'symfony/form') + ->addExtraDependencies('twig', 'symfony/form') ->run(function (MakerTestRunner $runner) { $this->makeUser($runner, 'email', false); From bdb8fb6db5d75a8d61edcdba704ab12384ed78f0 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 28 Dec 2022 14:27:49 -0500 Subject: [PATCH 2/2] add missing routing config --- tests/Maker/MakeAuthenticatorTest.php | 5 +++++ tests/fixtures/make-auth/annotations.yaml | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/fixtures/make-auth/annotations.yaml diff --git a/tests/Maker/MakeAuthenticatorTest.php b/tests/Maker/MakeAuthenticatorTest.php index 1dc3adf19..011b38bbc 100644 --- a/tests/Maker/MakeAuthenticatorTest.php +++ b/tests/Maker/MakeAuthenticatorTest.php @@ -282,6 +282,11 @@ private function runLoginTest(MakerTestRunner $runner, string $userIdentifier, b ] ); + // @legacy - In 5.4 tests, we need to tell Symfony to look for route attributes in `src/Controller` + if ('60000' > $runner->getSymfonyVersion()) { + $runner->copy('make-auth/annotations.yaml', 'config/routes/annotations.yaml'); + } + // plaintext password: needed for entities, simplifies overall $runner->modifyYamlFile('config/packages/security.yaml', function (array $config) { if (isset($config['when@test']['security']['password_hashers'])) { diff --git a/tests/fixtures/make-auth/annotations.yaml b/tests/fixtures/make-auth/annotations.yaml new file mode 100644 index 000000000..e92efc596 --- /dev/null +++ b/tests/fixtures/make-auth/annotations.yaml @@ -0,0 +1,7 @@ +controllers: + resource: ../../src/Controller/ + type: annotation + +kernel: + resource: ../../src/Kernel.php + type: annotation