change testcase import, add datetime to fake clock, style lines

This commit is contained in:
Yisroel Baum 2026-05-19 19:57:57 +03:00
parent 453e8284b4
commit 51537bbf24
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -6,10 +6,11 @@ use App\Auth\Clock;
use App\Auth\UseCases\CreateSession\CreateSession;
use App\Shared\ValueObject\EmailAddress;
use App\User\User;
use PHPUnit\Framework\TestCase;
use DateTimeImmutable;
use Tests\Fakes\FakeClock;
use Tests\Fakes\FakeSessionRepository;
use Tests\Fakes\FakeTokenGenerator;
use Tests\TestCase;
class CreateSessionTest extends TestCase
{
@ -22,9 +23,15 @@ class CreateSessionTest extends TestCase
{
$this->sessionRepo = new FakeSessionRepository();
$this->tokenGenerator = new FakeTokenGenerator();
$this->clock = new FakeClock();
$this->clock = new FakeClock(
new DateTimeImmutable('2026-05-18 12:00:00')
);
$this->createSession = new CreateSession($this->sessionRepo, $this->tokenGenerator, $this->clock);
$this->createSession = new CreateSession(
$this->sessionRepo,
$this->tokenGenerator,
$this->clock
);
}
public function testCreatesSessionForUser(): void