diff --git a/tests/Maker/MakeAuthenticatorTest.php b/tests/Maker/MakeAuthenticatorTest.php index e94baed3c..011b38bbc 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); @@ -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