now = new DateTimeImmutable( '2026-04-29T12:00:00', new DateTimeZone('UTC') ); $this->sessionRepo = new FakeSessionRepository; $this->useCase = new Logout($this->sessionRepo); } public function test_existing_token_session_is_removed(): void { $this->sessionRepo->create(new CreateSessionDto( token: 'token-abc', user: new User( id: 7, email: new EmailAddress('a@b.com'), passwordHash: 'password', ), createdAt: $this->now, expiresAt: $this->now->modify('+7 days'), )); $this->useCase->execute('token-abc'); $this->assertNull($this->sessionRepo->findByToken('token-abc')); } public function test_unknown_token_does_not_throw(): void { $this->useCase->execute('unknown-token'); $this->assertNull($this->sessionRepo->findByToken('unknown-token')); } }