ldc-boutique-cnc-sable/tests/Unit/Domain/Enums/Units/OrderUnitTest.php
Jérémy Munsch c40016bba1
feat(order): implement order placement and related DTOs
- Add methods to convert OrderLine and DeliveryAddress to DTOs.
- Introduce toPlacedEvent method in Order to generate domain event.
- Enhance OrderUnit with Regate code mapping.
- Implement tests for new functionality and ensure correctness.
2026-10-29 20:35:13 +01:00

24 lines
607 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Enums\Units;
use Domain\Enums\Units\OrderUnit;
describe('OrderUnit', function (): void {
it('returns the correct Regate code for each unit', function (OrderUnit $unit, string $expectedCode): void {
// GIVEN
// $unit and $expectedCode from dataset
// WHEN
$code = $unit->toRegateCode();
// THEN
expect($code)->toBe($expectedCode);
})->with([
'colis' => [OrderUnit::COLIS, 'UEA'],
'kgm' => [OrderUnit::KGM, 'KGM'],
'pce' => [OrderUnit::PCE, 'UB'],
]);
});