2026-08-14 11:33:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-08-14 15:38:10 +02:00
|
|
|
namespace Tests\Unit\Domain\Models\ValueObjects\Inco\Composition;
|
2026-08-14 11:33:05 +02:00
|
|
|
|
2026-08-14 15:38:10 +02:00
|
|
|
use Domain\Models\ValueObjects\Inco\Composition\FreshProduceAndNuts;
|
|
|
|
|
use Domain\Models\ValueObjects\Inco\Composition\FruitAndNutAmount;
|
|
|
|
|
use Domain\Models\ValueObjects\Inco\Composition\PercentageValue;
|
2026-08-14 11:33:05 +02:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
});
|