sessionRepo = new FakeSessionRepository(); $this->logout = new Logout($this->sessionRepo); } public function testDeletesSessionByToken(): void { $email = new EmailAddress('user@example.com'); $user = new User(1, $email, 'hashed-password'); $session = $this->sessionRepo->create(new \App\Auth\CreateSessionDto( 'session-token', $user, new \DateTimeImmutable(), new \DateTimeImmutable('+1 hour') )); $this->logout->execute('session-token'); $this->assertNull($this->sessionRepo->findByToken('session-token')); } }