25 lines
607 B
PHP
25 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'],
|
||
|
|
]);
|
||
|
|
});
|