ldc-arcadia-api/tests/Unit/Domain/Models/ValueObjects/IncoCompo/FreshProduceAndNutsTest.php
Jérémy Munsch 152ee2b5a2
feat(api): add IncoSheets feature with DDD clean architecture, tests & OpenAPI spec
- Use cases: FindAllIncoSheets & FindIncoSheet (filters, pagination, short projection)
- Presentation: controllers, FormRequests with scalar validation, DTOs (camelCase)
- Ports & Adapters: IncoSheetDirectory & EloquentIncoSheetDirectory
- Tests: Pest 4 unit, integration, OpenAPI spectator conformance, dynamic arch tests
- Docs: updated Bruno collection and OpenAPI spec
2026-08-14 11:33:05 +02:00

30 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects\IncoCompo;
use Domain\Models\ValueObjects\IncoCompo\FreshProduceAndNuts;
use Domain\Models\ValueObjects\IncoCompo\FruitAndNutAmount;
use Domain\Models\ValueObjects\IncoCompo\PercentageValue;
covers(FreshProduceAndNuts::class);
describe('FreshProduceAndNuts Value Object', function (): void {
it('can be instantiated with reference and portion fruit and nut amounts', function (): void {
// GIVEN
$reference = new FruitAndNutAmount('50', '25');
$portion = new FruitAndNutAmount('10', '5');
$fresh = new PercentageValue('10%');
$fruits = new PercentageValue('40%');
// WHEN
$freshProduce = new FreshProduceAndNuts($reference, $portion, $fresh, $fruits);
// THEN
expect($freshProduce->reference)->toBe($reference)
->and($freshProduce->portion)->toBe($portion)
->and($freshProduce->freshFnlPercentage)->toBe($fresh)
->and($freshProduce->fruitsPercentage)->toBe($fruits);
});
});