- 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
30 lines
877 B
PHP
30 lines
877 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Domain\Models\ValueObjects;
|
|
|
|
use Domain\Models\ValueObjects\SiteId;
|
|
|
|
covers(SiteId::class);
|
|
|
|
describe('SiteId Value Object Instantiation', function (): void {
|
|
it('accepts valid uppercase alphabetical site identifiers', function (string $input): void {
|
|
// GIVEN
|
|
$value = $input;
|
|
|
|
// WHEN
|
|
$vo = new SiteId($value);
|
|
|
|
// THEN
|
|
expect($vo->value)->toBe($value);
|
|
})->with(['LDCSER', 'SLELA', 'DDE', 'SITE']);
|
|
});
|
|
|
|
describe('SiteId Value Object Domain Rules', function (): void {
|
|
it('rejects lowercase, numeric, or too short site identifiers', function (string $invalid): void {
|
|
// GIVEN / WHEN / THEN
|
|
expect(fn () => new SiteId($invalid))
|
|
->toThrow(\DomainException::class);
|
|
})->with(['site', 'LDCSER01', 'A', '123', '', 'LD CSER']);
|
|
});
|