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\NutrientValue;
|
|
|
|
|
use Domain\Models\ValueObjects\Inco\Composition\ReferenceMacronutrients;
|
2026-08-14 11:33:05 +02:00
|
|
|
|
|
|
|
|
covers(ReferenceMacronutrients::class);
|
|
|
|
|
|
|
|
|
|
describe('ReferenceMacronutrients Value Object', function (): void {
|
|
|
|
|
it('can be instantiated with reference macronutrients', function (): void {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$val = new NutrientValue('10.0');
|
|
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$ref = new ReferenceMacronutrients(
|
|
|
|
|
fat: $val,
|
|
|
|
|
saturatedFat: $val,
|
|
|
|
|
carbohydrates: $val,
|
|
|
|
|
sugars: $val,
|
|
|
|
|
fiber: $val,
|
|
|
|
|
protein: $val,
|
|
|
|
|
salt: $val,
|
|
|
|
|
sodium: '0.4',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($ref->fat)->toBe($val)
|
|
|
|
|
->and($ref->saturatedFat)->toBe($val)
|
|
|
|
|
->and($ref->sodium)->toBe('0.4');
|
|
|
|
|
});
|
|
|
|
|
});
|