ldc-arcadia-api/tests/Unit/Domain/Models/ValueObjects/BrandCodeTest.php
2026-08-13 12:10:53 +02:00

28 lines
723 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects;
use Domain\Models\ValueObjects\BrandCode;
covers(BrandCode::class);
describe('BrandCode Value Object', function (): void {
it('accepts valid positive brand codes', function (int $input): void {
// GIVEN
$value = $input;
// WHEN
$brandCode = new BrandCode($value);
// THEN
expect($brandCode->value)->toBe($value);
})->with([13, 1, 9999]);
it('rejects zero or negative brand codes', function (int $invalid): void {
// GIVEN / WHEN / THEN
expect(fn () => new BrandCode($invalid))
->toThrow(\DomainException::class);
})->with([0, -1, -9999]);
});