name, role, active */ public array $users = []; public function addUser(int $id, string $name, Role $role = Role::Employee, bool $active = true): void { $this->users[$id] = [$name, $role, $active]; } public function findSummary(int $id): ?UserSummary { throw new LogicException('Not needed in unit tests.'); } public function paginate(?string $search, int $perPage = 25): LengthAwarePaginator { throw new LogicException('Not needed in unit tests.'); } public function pinLoginOptions(): array { return []; } public function supervisorOptions(?int $exceptUserId = null): array { return []; } public function activeUserOptions(): array { $options = []; foreach ($this->users as $id => [$name, $role, $active]) { if ($active) { $options[] = new UserOption($id, $name, $role); } } return $options; } public function namesByIds(array $ids): array { return array_map(fn (array $user): string => $user[0], array_intersect_key($this->users, array_flip($ids))); } }