58 lines
1.4 KiB
PHP
58 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Support\Mothers;
|
|
|
|
use Application\Arcadia\Usecase\IncoSheets\Find\Output;
|
|
use Domain\Models\Entities\Inco\IncoSheet;
|
|
use Tests\Support\Builders\IncoSheetTestBuilder;
|
|
|
|
final class IncoSheetMother
|
|
{
|
|
public static function create(?string $id = null, ?string $name = null, ?string $brand = null): IncoSheet
|
|
{
|
|
$builder = IncoSheetTestBuilder::create();
|
|
|
|
if ($id !== null) {
|
|
$builder->withId($id);
|
|
}
|
|
|
|
if ($name !== null) {
|
|
$builder->withName($name);
|
|
}
|
|
|
|
if ($brand !== null) {
|
|
$builder->withBrand($brand);
|
|
}
|
|
|
|
return $builder->build();
|
|
}
|
|
|
|
public static function createOutput(?string $id = null, ?string $name = null): Output
|
|
{
|
|
$builder = IncoSheetTestBuilder::create();
|
|
|
|
if ($id !== null) {
|
|
$builder->withId($id);
|
|
}
|
|
|
|
if ($name !== null) {
|
|
$builder->withName($name);
|
|
}
|
|
|
|
return $builder->buildOutput();
|
|
}
|
|
|
|
public static function pouletRoti(): IncoSheet
|
|
{
|
|
return IncoSheetTestBuilder::create()
|
|
->withId('12345')
|
|
->withName('Poulet Rôti 1kg')
|
|
->withLabel('Poulet Rôti Classe A')
|
|
->withDescription('Poulet prêt à cuire')
|
|
->withBrand('Le Gaulois', 'LGL01', 504)
|
|
->withNutriscore('A')
|
|
->build();
|
|
}
|
|
}
|