refactor : factoriser mapStandardResponse + includesEarTagStock nullable

This commit is contained in:
2026-04-21 08:49:28 +02:00
parent 56c852ed59
commit c7709de753
6 changed files with 72 additions and 47 deletions

View File

@@ -8,6 +8,7 @@ use DateTimeImmutable;
use Malio\EdnotifBundle\Bovin\Dto\InventoryDto;
use Malio\EdnotifBundle\Bovin\Mapper\AnimalSummaryMapper;
use Malio\EdnotifBundle\Bovin\Mapper\InventoryMapper;
use Malio\EdnotifBundle\Shared\Mapper\StandardResponseMapper;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use stdClass;
@@ -20,7 +21,7 @@ final class InventoryMapperTest extends TestCase
{
public function testMapFullInventory(): void
{
$mapper = new InventoryMapper(new AnimalSummaryMapper());
$mapper = new InventoryMapper(new AnimalSummaryMapper(), new StandardResponseMapper());
$inventory = $mapper->map($this->makeSoapResponse(), $this->makeUnzippedMessage());
@@ -37,7 +38,7 @@ final class InventoryMapperTest extends TestCase
public function testMapInventoryWithoutMessageZipReturnsEmptyLists(): void
{
$mapper = new InventoryMapper(new AnimalSummaryMapper());
$mapper = new InventoryMapper(new AnimalSummaryMapper(), new StandardResponseMapper());
$soapResponse = new stdClass();
$soapResponse->ReponseStandard = new stdClass();