ldc-mesbr-app/tests/Architecture/NamingConventionsTest.php
2026-09-08 16:33:54 +02:00

63 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
describe('naming conventions in application', function (): void {
arch('casts have Cast suffix')
->expect('Application\\Cast')
->toHaveSuffix('Cast');
arch('adapters repositories have Repository suffix')
->expect('Application\\Adapters\\Repositories')
->toHaveSuffix('Repository');
arch('exceptions have Exception suffix')
->expect('Application\\Exceptions')
->toHaveSuffix('Exception');
arch('controllers have Controller suffix')
->expect('Application\\Http\\Controllers')
->toHaveSuffix('Controller');
arch('requests have Request suffix')
->expect('Application\\Http\\Requests')
->toHaveSuffix('Request');
arch('resources have Resource suffix')
->expect('Application\\Http\\Resources')
->toHaveSuffix('Resource');
arch('policies have Policy suffix')
->expect('Application\\Policies')
->toHaveSuffix('Policy');
arch('providers have Provider suffix')
->expect('Application\\Providers')
->toHaveSuffix('Provider');
arch('services have Service suffix')
->expect('Application\\Services')
->toHaveSuffix('Service');
});
describe('naming conventions in domain', function (): void {
arch('dtos have Dto suffix')
->expect('Domain\\Dto')
->toHaveSuffix('Dto');
arch('exceptions have Exception suffix')
->expect('Domain\\Exceptions')
->toHaveSuffix('Exception');
arch('policies have Policy suffix')
->expect('Domain\\Policies')
->toHaveSuffix('Policy');
arch('port repositories have Repository suffix')
->expect('Domain\\Ports\\Repositories')
->toHaveSuffix('Repository');
arch('domain services have Service suffix')
->expect('Domain\\Services')
->toHaveSuffix('Service');
});