6
6
class ResetPasswordTest extends WebTestCase
7
7
{
8
8
private KernelBrowser $client;
9
- private EntityManager $em;
9
+ private EntityManagerInterface $em;
10
10
private <?= $ user_repo_short_name ?> $userRepository;
11
11
12
12
protected function setUp(): void
@@ -15,8 +15,12 @@ protected function setUp(): void
15
15
16
16
// Ensure we have a clean database
17
17
$container = static::getContainer();
18
- $this->em = $container->get('doctrine')->getManager();
19
- $this->userRepository = $this->em->getRepository(<?= $ user_short_name ?> ::class);
18
+
19
+ /** @var EntityManagerInterface $em */
20
+ $em = $container->get('doctrine')->getManager();
21
+ $this->em = $em;
22
+
23
+ $this->userRepository = $container->get(<?= $ user_repo_short_name ?> ::class);
20
24
21
25
foreach ($this->userRepository->findAll() as $user) {
22
26
$this->em->remove($user);
@@ -25,7 +29,7 @@ protected function setUp(): void
25
29
$this->em->flush();
26
30
}
27
31
28
- public function testMaker (): void
32
+ public function testResetPasswordController (): void
29
33
{
30
34
// Create a test user
31
35
$user = (new <?= $ user_short_name ?> ())
@@ -85,6 +89,8 @@ public function testMaker(): void
85
89
86
90
$user = $this->userRepository->findOneBy(['email' => 'me@example.com']);
87
91
92
+ self::assertInstanceOf(<?= $ user_short_name ?> ::class, $user);
93
+
88
94
/** @var UserPasswordHasherInterface $passwordHasher */
89
95
$passwordHasher = static::getContainer()->get(UserPasswordHasherInterface::class);
90
96
self::assertTrue($passwordHasher->isPasswordValid($user, 'newStrongPassword'));
0 commit comments