66class ResetPasswordTest extends WebTestCase
77{
88 private KernelBrowser $client;
9- private EntityManager $em;
9+ private EntityManagerInterface $em;
1010 private <?= $ user_repo_short_name ?> $userRepository;
1111
1212 protected function setUp(): void
@@ -15,8 +15,12 @@ protected function setUp(): void
1515
1616 // Ensure we have a clean database
1717 $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);
2024
2125 foreach ($this->userRepository->findAll() as $user) {
2226 $this->em->remove($user);
@@ -25,7 +29,7 @@ protected function setUp(): void
2529 $this->em->flush();
2630 }
2731
28- public function testMaker (): void
32+ public function testResetPasswordController (): void
2933 {
3034 // Create a test user
3135 $user = (new <?= $ user_short_name ?> ())
@@ -85,6 +89,8 @@ public function testMaker(): void
8589
8690 $user = $this->userRepository->findOneBy(['email' => '
[email protected] ']);
8791
92+ self::assertInstanceOf(<?= $ user_short_name ?> ::class, $user);
93+
8894 /** @var UserPasswordHasherInterface $passwordHasher */
8995 $passwordHasher = static::getContainer()->get(UserPasswordHasherInterface::class);
9096 self::assertTrue($passwordHasher->isPasswordValid($user, 'newStrongPassword'));
0 commit comments