ldc-arcadia-api/tests/Unit/Domain/Models/ValueObjects/Entities/IncoCompoIdTest.php
Jérémy Munsch 152ee2b5a2
feat(api): add IncoSheets feature with DDD clean architecture, tests & OpenAPI spec
- Use cases: FindAllIncoSheets & FindIncoSheet (filters, pagination, short projection)
- Presentation: controllers, FormRequests with scalar validation, DTOs (camelCase)
- Ports & Adapters: IncoSheetDirectory & EloquentIncoSheetDirectory
- Tests: Pest 4 unit, integration, OpenAPI spectator conformance, dynamic arch tests
- Docs: updated Bruno collection and OpenAPI spec
2026-08-14 11:33:05 +02:00

28 lines
772 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects\Entities;
use Domain\Models\ValueObjects\Entities\IncoCompoId;
covers(IncoCompoId::class);
describe('IncoCompoId Value Object', function (): void {
it('accepts valid numeric values', function (string $input): void {
// GIVEN
$value = $input;
// WHEN
$vo = new IncoCompoId($value);
// THEN
expect($vo->value)->toBe($value);
})->with(['123', '0', '999999']);
it('rejects invalid non-numeric or empty values', function (string $invalid): void {
// GIVEN / WHEN / THEN
expect(fn () => new IncoCompoId($invalid))
->toThrow(\DomainException::class);
})->with(['abc', '12a', '', ' 123 ', '-5']);
});