Skip to content

Commit a858481

Browse files
authored
[make:reset-password] doctrine/annotations are not needed (#1262)
1 parent 1ee6fdf commit a858481

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Maker/MakeResetPassword.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\MakerBundle\Maker;
1313

14-
use Doctrine\Common\Annotations\Annotation;
1514
use Doctrine\ORM\EntityManagerInterface;
1615
use PhpParser\Builder\Param;
1716
use Symfony\Bridge\Twig\AppVariable;
@@ -122,8 +121,6 @@ public function configureDependencies(DependencyBuilder $dependencies): void
122121

123122
ORMDependencyBuilder::buildDependencies($dependencies);
124123

125-
$dependencies->addClassDependency(Annotation::class, 'annotations');
126-
127124
// reset-password-bundle 1.6 includes the ability to generate a fake token.
128125
// we need to check that version 1.6 is installed
129126
if (class_exists(ResetPasswordHelper::class) && !method_exists(ResetPasswordHelper::class, 'generateFakeResetToken')) {

tests/Maker/MakeResetPasswordTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public function getTestDetails(): \Generator
7777
'tests/ResetPasswordFunctionalTest.php'
7878
);
7979

80+
if (60000 > $runner->getSymfonyVersion()) {
81+
// @legacy - In 5.4 tests, we need to tell Symfony to look for the route attributes in `src/Controller`
82+
$runner->copy('router-annotations.yaml', 'config/routes/annotations.yaml');
83+
}
84+
8085
$runner->runTests();
8186
}),
8287
];

tests/fixtures/make-reset-password/tests/it_generates_with_normal_setup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66

77
class ResetPasswordFunctionalTest extends WebTestCase
88
{
9-
public function testResetRequestRoute()
9+
public function testResetRequestRoute(): void
1010
{
1111
$client = static::createClient();
1212
$client->request('GET', '/reset-password');
1313

1414
self::assertSame(200, $client->getResponse()->getStatusCode());
1515
}
1616

17-
public function testResetRequestRouteDeniesInvalidToken()
17+
public function testResetRequestRouteDeniesInvalidToken(): void
1818
{
1919
$client = static::createClient();
2020
$client->request('GET', '/reset-password/reset/badToken1234');
2121

2222
self::assertSame(302, $client->getResponse()->getStatusCode());
2323
}
2424

25-
public function testCheckEmailPageIsAlwaysAccessible()
25+
public function testCheckEmailPageIsAlwaysAccessible(): void
2626
{
2727
$client = static::createClient();
2828
$client->request('GET', '/reset-password/check-email');

0 commit comments

Comments
 (0)