From 2900c85b33ac2ad6d21e620a7794376319475ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Fri, 14 Aug 2026 16:26:08 +0200 Subject: [PATCH] test(IncoSheets): add test for PaginatedShortIncoSheet instantiation Added a test to verify the correct instantiation of PaginatedShortIncoSheet from the IncoShortSheet domain entity. --- .../Usecase/Incosheets/FindAllIncoSheetsDtoTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/Unit/Application/Usecase/Incosheets/FindAllIncoSheetsDtoTest.php b/tests/Unit/Application/Usecase/Incosheets/FindAllIncoSheetsDtoTest.php index ee8b42c..dcfa900 100644 --- a/tests/Unit/Application/Usecase/Incosheets/FindAllIncoSheetsDtoTest.php +++ b/tests/Unit/Application/Usecase/Incosheets/FindAllIncoSheetsDtoTest.php @@ -12,6 +12,7 @@ use Application\Usecase\IncoSheets\FindAll\PaginatedShortIncoSheet; use Application\Usecase\IncoSheets\FindAll\SortColumn; use Application\Usecase\IncoSheets\FindAll\Sorter; use Domain\Models\Entities\Inco\IncoSheet; +use Domain\Models\Entities\Inco\IncoShortSheet; use Domain\Models\ValueObjects\Inco\Allegations; use Domain\Models\ValueObjects\Inco\Brand; use Domain\Models\ValueObjects\Inco\IncoId; @@ -91,9 +92,17 @@ describe('FindAllIncoSheets DTOs Instantiation & Logic', function (): void { updatedAt: null, ); + $shortSheet = new IncoShortSheet( + id: $incoId, + name: 'Poulet Rôti 1kg', + label: 'Poulet Rôti Classe A', + createdAt: null, + updatedAt: null, + ); + // WHEN $full = PaginatedIncoSheet::fromDomain($incoSheet); - $short = PaginatedShortIncoSheet::fromDomain($incoSheet); + $short = PaginatedShortIncoSheet::fromDomain($shortSheet); $output = new Output([$full, $short], 1, 1, 10); // THEN