38 lines
1 KiB
PHP
38 lines
1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Tests\Unit\Domain\Models\ValueObjects\IncoCompo;
|
||
|
|
|
||
|
|
use Domain\Models\ValueObjects\IncoCompo\PercentageValue;
|
||
|
|
use Domain\Models\ValueObjects\IncoCompo\ReferenceIntakes;
|
||
|
|
|
||
|
|
covers(ReferenceIntakes::class);
|
||
|
|
|
||
|
|
describe('ReferenceIntakes Value Object', function (): void {
|
||
|
|
it('can be instantiated with reference intakes percentage values', function (): void {
|
||
|
|
// GIVEN
|
||
|
|
$pct = new PercentageValue('10%');
|
||
|
|
|
||
|
|
// WHEN
|
||
|
|
$ri = new ReferenceIntakes(
|
||
|
|
energyE14: $pct,
|
||
|
|
energyKj: $pct,
|
||
|
|
fat: $pct,
|
||
|
|
saturatedFat: $pct,
|
||
|
|
carbohydrates: $pct,
|
||
|
|
sugars: $pct,
|
||
|
|
protein: $pct,
|
||
|
|
salt: $pct,
|
||
|
|
portionAmount: '100g',
|
||
|
|
proteinToLipidRatio: '1.2',
|
||
|
|
);
|
||
|
|
|
||
|
|
// THEN
|
||
|
|
expect($ri->energyE14)->toBe($pct)
|
||
|
|
->and($ri->fat)->toBe($pct)
|
||
|
|
->and($ri->portionAmount)->toBe('100g')
|
||
|
|
->and($ri->proteinToLipidRatio)->toBe('1.2');
|
||
|
|
});
|
||
|
|
});
|