37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Tests\Repository;
|
||
|
|
|
||
|
|
use App\Entity\AccountResetPasswordRequest;
|
||
|
|
use App\Repository\AccountResetPasswordRequestRepository;
|
||
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||
|
|
use Doctrine\ORM\EntityManagerInterface;
|
||
|
|
|
||
|
|
class AccountResetPasswordRequestRepositoryTest extends KernelTestCase
|
||
|
|
{
|
||
|
|
private ?EntityManagerInterface $entityManager;
|
||
|
|
private ?AccountResetPasswordRequestRepository $accountResetPasswordRequestRepository;
|
||
|
|
|
||
|
|
protected function setUp(): void
|
||
|
|
{
|
||
|
|
self::bootKernel();
|
||
|
|
$this->entityManager = self::getContainer()->get('doctrine')->getManager();
|
||
|
|
$this->accountResetPasswordRequestRepository = $this->entityManager->getRepository(AccountResetPasswordRequest::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function testRepositoryExistsAndIsCorrectInstance(): void
|
||
|
|
{
|
||
|
|
$this->assertInstanceOf(AccountResetPasswordRequestRepository::class, $this->accountResetPasswordRequestRepository);
|
||
|
|
}
|
||
|
|
|
||
|
|
protected function tearDown(): void
|
||
|
|
{
|
||
|
|
parent::tearDown();
|
||
|
|
|
||
|
|
$this->entityManager->close();
|
||
|
|
$this->entityManager = null; // Avoid memory leaks
|
||
|
|
$this->accountResetPasswordRequestRepository = null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|