change testcase import, add datetime to fake clock, style lines
This commit is contained in:
parent
453e8284b4
commit
51537bbf24
1 changed files with 10 additions and 3 deletions
|
|
@ -6,10 +6,11 @@ use App\Auth\Clock;
|
||||||
use App\Auth\UseCases\CreateSession\CreateSession;
|
use App\Auth\UseCases\CreateSession\CreateSession;
|
||||||
use App\Shared\ValueObject\EmailAddress;
|
use App\Shared\ValueObject\EmailAddress;
|
||||||
use App\User\User;
|
use App\User\User;
|
||||||
use PHPUnit\Framework\TestCase;
|
use DateTimeImmutable;
|
||||||
use Tests\Fakes\FakeClock;
|
use Tests\Fakes\FakeClock;
|
||||||
use Tests\Fakes\FakeSessionRepository;
|
use Tests\Fakes\FakeSessionRepository;
|
||||||
use Tests\Fakes\FakeTokenGenerator;
|
use Tests\Fakes\FakeTokenGenerator;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
class CreateSessionTest extends TestCase
|
class CreateSessionTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
@ -22,9 +23,15 @@ class CreateSessionTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->sessionRepo = new FakeSessionRepository();
|
$this->sessionRepo = new FakeSessionRepository();
|
||||||
$this->tokenGenerator = new FakeTokenGenerator();
|
$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
|
public function testCreatesSessionForUser(): void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue