feat : parser SerieBoucles dans EarTagSeriesDto typé

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-22 09:06:51 +02:00
parent 08dbd9a72b
commit c2ed7597ef
4 changed files with 96 additions and 18 deletions

View File

@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace Malio\EdnotifBundle\Tests\Unit\Bovin\Dto;
use Malio\EdnotifBundle\Bovin\Dto\EarTagSeriesDto;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
/**
* @internal
*/
#[CoversClass(EarTagSeriesDto::class)]
final class EarTagSeriesDtoTest extends TestCase
{
public function testEndNumberComputesStartPlusQuantityMinusOne(): void
{
$series = new EarTagSeriesDto(
countryCode: 'FR',
startNumber: '0012345678',
quantity: 50,
);
self::assertSame('0012345727', $series->endNumber());
}
public function testEndNumberPreservesLeadingZeroPadding(): void
{
$series = new EarTagSeriesDto(
countryCode: 'FR',
startNumber: '0000000001',
quantity: 5,
);
self::assertSame('0000000005', $series->endNumber());
}
public function testEndNumberWithQuantityOneEqualsStartNumber(): void
{
$series = new EarTagSeriesDto(
countryCode: 'FR',
startNumber: '0012345678',
quantity: 1,
);
self::assertSame('0012345678', $series->endNumber());
}
}