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