- 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
34 lines
923 B
PHP
34 lines
923 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Domain\Models\ValueObjects\IncoCompo;
|
|
|
|
use Domain\Models\ValueObjects\IncoCompo\NutrientValue;
|
|
use Domain\Models\ValueObjects\IncoCompo\PortionMacronutrients;
|
|
|
|
covers(PortionMacronutrients::class);
|
|
|
|
describe('PortionMacronutrients Value Object', function (): void {
|
|
it('can be instantiated with portion macronutrients', function (): void {
|
|
// GIVEN
|
|
$val = new NutrientValue('10.0');
|
|
|
|
// WHEN
|
|
$portion = new PortionMacronutrients(
|
|
fat: $val,
|
|
saturatedFat: $val,
|
|
carbohydrates: $val,
|
|
sugars: $val,
|
|
fiber: $val,
|
|
protein: $val,
|
|
salt: $val,
|
|
sodium: '0.4',
|
|
);
|
|
|
|
// THEN
|
|
expect($portion->fat)->toBe($val)
|
|
->and($portion->saturatedFat)->toBe($val)
|
|
->and($portion->sodium)->toBe('0.4');
|
|
});
|
|
});
|