clear(); $shortDirectory->clear(); }); it('executes successfully and returns paginated output DTO', function () use ($directory, $shortDirectory): void { // GIVEN $incoId = new IncoId('12345'); $incoSheet = IncoSheet::hydrate( id: $incoId, name: 'Poulet Rôti 1kg', label: 'Poulet Rôti Classe A', description: 'Poulet prêt à cuire', allegations: new Allegations(['Volaille française']), sellArguments: 'Délicieux', preparationAdvices: 'Cuire 45min à 180°C', tips: null, sellFamilly: 'Boucherie', ingredients: new Ingredients(['Ingrédients' => ['Viande de dinde (66%)']]), portions: null, allergens: [], brand: new IncoBrand(new BrandName('Le Gaulois'), new BrandCode('LGL01'), new ArcadiaId('1')), isSeasonal: true, weight: null, nutriscore: null, storageCondition: null, additives: [], compo: null, createdAt: null, updatedAt: null, ); $directory->add($incoSheet); $usecase = new FindAllIncoSheets($directory, $shortDirectory); $pagination = Pagination::ofPage(new PageNumber(1), new PageSize(10)); $sorter = new IncoSheetSorter(IncoSheetSortColumn::incoSheetId, \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->incoSheets)->toHaveCount(1) ->and($result->incoSheets[0]->name)->toBe('Poulet Rôti 1kg'); }); });