clear(); }); it('executes successfully and returns paginated output DTO', function () use ($directory): void { // GIVEN $employeeId = new SiRhMatricule('01155902'); $employee = Employee::hydrate( publicEmployeeNumber: $employeeId, lastName: 'DOE', firstName: 'John', startDate: new \DateTimeImmutable('2024-01-01'), endDate: null, plannedEndDate: null, establishment: new EstablishmentCode('EST01'), site: new SiteId('LDCSER'), service: new ServiceId('097'), createdAt: new \DateTimeImmutable('2024-01-01'), updatedAt: null, ); $directory->add($employee); $usecase = new FindAllEmployees($directory); $pagination = Pagination::ofPage(1, 10); $sorter = new EmployeeSorter( EmployeeSortColumn::arcadiaId, \SortDirection::Ascending ); $input = new Input($pagination, $sorter); // WHEN $result = $usecase->execute($input); // THEN expect($result)->toBeInstanceOf(Output::class) ->and($result->total)->toBe(1) ->and($result->page)->toBe(1) ->and($result->perPage)->toBe(10) ->and($result->employees)->toHaveCount(1) ->and($result->employees[0]->firstName)->toBe('John'); }); });