Skip to content

[make:reset-password] doctrine/annotations are not needed #1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Maker/MakeResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Bundle\MakerBundle\Maker;

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

ORMDependencyBuilder::buildDependencies($dependencies);

$dependencies->addClassDependency(Annotation::class, 'annotations');

// reset-password-bundle 1.6 includes the ability to generate a fake token.
// we need to check that version 1.6 is installed
if (class_exists(ResetPasswordHelper::class) && !method_exists(ResetPasswordHelper::class, 'generateFakeResetToken')) {
Expand Down
5 changes: 5 additions & 0 deletions tests/Maker/MakeResetPasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public function getTestDetails(): \Generator
'tests/ResetPasswordFunctionalTest.php'
);

if (60000 > $runner->getSymfonyVersion()) {
// @legacy - In 5.4 tests, we need to tell Symfony to look for the route attributes in `src/Controller`
$runner->copy('router-annotations.yaml', 'config/routes/annotations.yaml');
}

$runner->runTests();
}),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

class ResetPasswordFunctionalTest extends WebTestCase
{
public function testResetRequestRoute()
public function testResetRequestRoute(): void
{
$client = static::createClient();
$client->request('GET', '/reset-password');

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

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

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

public function testCheckEmailPageIsAlwaysAccessible()
public function testCheckEmailPageIsAlwaysAccessible(): void
{
$client = static::createClient();
$client->request('GET', '/reset-password/check-email');
Expand Down