sessionRepo = new FakeSessionRepository(); $this->useCase = new Logout($this->sessionRepo); $userRepo = new FakeUserRepository(); $user = $userRepo->create(new CreateUserDto( email: new EmailAddress('user@example.com'), passwordHash: 'hashed:password', )); $this->sessionRepo->create(new CreateSessionDto( token: 'session-token', user: $user, createdAt: new DateTimeImmutable('2026-05-16 12:00:00'), expiresAt: new DateTimeImmutable('2026-05-23 12:00:00'), )); } public function testDeletesSessionByToken(): void { $this->useCase->execute('session-token'); $this->assertNull( $this->sessionRepo->findByToken('session-token'), ); } public function testDoesNotThrowForUnknownToken(): void { $this->useCase->execute('nonexistent-token'); $this->assertTrue(true); } }