ldc-boutique-cnc-sable/tests/Unit/Domain/Enums/Units/OrderUnitTest.php

25 lines
607 B
PHP
Raw Permalink Normal View History

<?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'],
]);
});