since)->toBe($since) ->and($filter->brands)->toBe(['M01', 'M02']); }); it('throws InvalidArgumentException for empty brand string in Filter', function (): void { expect(fn () => new Filter(null, ' ')) ->toThrow(\InvalidArgumentException::class); }); it('throws InvalidArgumentException for empty Filter parameters', function (): void { expect(fn () => new Filter(null)) ->toThrow(\InvalidArgumentException::class); }); it('instantiates Input DTO', function (): void { // GIVEN $pagination = Pagination::ofPage(1, 10); $sorter = new Sorter(SortColumn::incoSheetId, \SortDirection::Ascending); // WHEN $input = new Input($pagination, $sorter); // THEN expect($input->pagination)->toBe($pagination) ->and($input->sorter)->toBe($sorter); }); it('creates PaginatedIncoSheet and PaginatedShortIncoSheet from domain entity and instantiates Output DTO', function (): void { // GIVEN $incoId = new IncoId('12345'); $incoSheet = new IncoSheet( 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', tips: null, sellFamilly: 'Boucherie', ingredients: new Ingredients(['main' => ['Viande']]), portions: null, allergens: [], brand: new Brand('M01', 'Le Gaulois'), isSeasonal: true, weight: null, nutriscore: null, storageCondition: null, additives: [], compo: null, createdAt: null, updatedAt: null, ); // WHEN $full = PaginatedIncoSheet::fromDomain($incoSheet); $short = PaginatedShortIncoSheet::fromDomain($incoSheet); $output = new Output([$full, $short], 1, 1, 10); // THEN expect($full->id)->toBe($incoId) ->and($full->name)->toBe('Poulet Rôti 1kg') ->and($short->id)->toBe($incoId) ->and($short->label)->toBe('Poulet Rôti Classe A') ->and($output->total)->toBe(1) ->and($output->incoSheets)->toHaveCount(2); }); });