Refatoring : Working state
This commit is contained in:
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\Auth;
|
||||
|
||||
use App\Auth\Application\AuthApplicationService as AuthService;
|
||||
use App\Auth\Application\AuthApplicationService;
|
||||
use App\Auth\LoginAttemptRepositoryInterface;
|
||||
use App\Shared\Http\SessionManagerInterface;
|
||||
use App\User\UserRepositoryInterface;
|
||||
@@ -11,11 +11,11 @@ use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Tests unitaires pour la protection anti-brute force de AuthService.
|
||||
* Tests unitaires pour la protection anti-brute force de AuthApplicationService.
|
||||
*
|
||||
* Vérifie le comportement de checkRateLimit(), recordFailure() et
|
||||
* resetRateLimit(). Les constantes testées correspondent aux valeurs
|
||||
* définies dans AuthService :
|
||||
* définies dans AuthApplicationService :
|
||||
* - MAX_ATTEMPTS = 5 : nombre d'échecs avant verrouillage
|
||||
* - LOCK_MINUTES = 15 : durée du verrouillage en minutes
|
||||
*/
|
||||
@@ -31,7 +31,7 @@ final class AuthServiceRateLimitTest extends TestCase
|
||||
/** @var LoginAttemptRepositoryInterface&MockObject */
|
||||
private LoginAttemptRepositoryInterface $loginAttemptRepository;
|
||||
|
||||
private AuthService $service;
|
||||
private AuthApplicationService $service;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
@@ -39,7 +39,7 @@ final class AuthServiceRateLimitTest extends TestCase
|
||||
$this->sessionManager = $this->createMock(SessionManagerInterface::class);
|
||||
$this->loginAttemptRepository = $this->createMock(LoginAttemptRepositoryInterface::class);
|
||||
|
||||
$this->service = new AuthService(
|
||||
$this->service = new AuthApplicationService(
|
||||
$this->userRepository,
|
||||
$this->sessionManager,
|
||||
$this->loginAttemptRepository,
|
||||
|
||||
Reference in New Issue
Block a user