<?php

use PHPUnit\Framework\TestCase;
use App\Services\AuthService;

class LoginLockTest extends TestCase
{
    public function testAccountGetsLockedAfterFiveFailures(): void
    {
        $auth = new AuthService();

        for ($i = 0; $i < 5; $i++) {
            try {
                $auth->login('demo', 'wrongpass', 'LIC-ABC-123');
            } catch (\Exception $e) {
                // ignore
            }
        }

        $this->expectException(Exception::class);

        $auth->login('demo', '123456', 'LIC-ABC-123');
    }
}
