62 lines
1.8 KiB
PHP
62 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Application\Usecase\IncoSheets;
|
|
|
|
use Application\Usecase\IncoSheets\Find\Input;
|
|
use Application\Usecase\IncoSheets\Find\Output;
|
|
use Domain\Models\ValueObjects\Inco\Allegations;
|
|
use Domain\Models\ValueObjects\Inco\Brand;
|
|
use Domain\Models\ValueObjects\Inco\IncoId;
|
|
use Domain\Models\ValueObjects\Inco\Ingredients;
|
|
|
|
covers(Input::class, Output::class);
|
|
|
|
describe('FindIncoSheet DTO Instantiation', function (): void {
|
|
it('can instantiate Input DTO', function (): void {
|
|
// GIVEN
|
|
$id = new IncoId('12345');
|
|
|
|
// WHEN
|
|
$input = new Input($id);
|
|
|
|
// THEN
|
|
expect($input->id)->toBe($id);
|
|
});
|
|
|
|
it('can instantiate Output DTO', function (): void {
|
|
// GIVEN
|
|
$id = new IncoId('12345');
|
|
|
|
// WHEN
|
|
$output = new Output(
|
|
id: $id,
|
|
name: 'Poulet Rôti 1kg',
|
|
label: 'Poulet Rôti Classe A',
|
|
description: 'Poulet prêt à cuire',
|
|
allegations: new Allegations(['Volaille française']),
|
|
sellArguments: 'Origine France',
|
|
preparationAdvices: 'Cuire 45min',
|
|
tips: null,
|
|
sellFamilly: 'Volaille',
|
|
ingredients: new Ingredients(['main' => ['Viande']]),
|
|
portions: null,
|
|
allergens: [],
|
|
brand: new Brand('M01', 'Le Gaulois'),
|
|
isSeasonal: true,
|
|
weight: null,
|
|
nutriscore: null,
|
|
storageCondition: null,
|
|
additives: [],
|
|
compo: null,
|
|
createdAt: null,
|
|
updatedAt: null,
|
|
);
|
|
|
|
// THEN
|
|
expect($output->id)->toBe($id)
|
|
->and($output->name)->toBe('Poulet Rôti 1kg')
|
|
->and($output->isSeasonal)->toBeTrue();
|
|
});
|
|
});
|