ldc-arcadia-api/tests/Architecture/PresentationTest.php
Jérémy Munsch 84e59314a0
test(Architecture): add namespaces to architecture test files and create integration test suite
- Added namespaces to various architecture test files for consistency.
- Created a new integration test suite in phpunit.xml.
2026-08-13 11:25:08 +02:00

37 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Architecture;
use Presentation\Api\V1\Contracts\ApiResponse;
describe('Presentation Architecture Rules', function (): void {
arch('Presentation layer does not depend on Infra or App')
->expect('Presentation')
->not->toUse([
'Infra',
'Infrastructure',
'App',
]);
arch('Presentation Controllers are invokable single action controllers')
->expect('Presentation\Api\V1\Http\Controllers')
->toBeInvokable();
arch('Presentation Responses implement Presentation\Api\V1\Contracts\ApiResponse')
->expect('Presentation\Api\V1\Http\Responses')
->toImplement(ApiResponse::class);
arch('Presentation FormRequests extend Illuminate\Foundation\Http\FormRequest')
->expect('Presentation\Api\V1\Http\Requests')
->toExtend('Illuminate\Foundation\Http\FormRequest');
arch('Presentation FormRequests do not contain toInput method')
->expect('Presentation\Api\V1\Http\Requests')
->not->toHaveMethod('toInput');
arch('Presentation layer uses strict types')
->expect('Presentation')
->toUseStrictTypes();
});