ldc-mesbr-app/tests/Architecture/NamingConventionsTest.php

25 lines
668 B
PHP
Raw Normal View History

2026-07-24 17:19:56 +02:00
<?php
declare(strict_types=1);
use Shared\DDD\UseCases\Input;
2026-07-24 17:19:56 +02:00
describe('naming conventions', function (): void {
arch('all exceptions have Exception suffix')
->expect(['Application', 'Domain', 'Shared'])
->classes()
->extending(\Throwable::class)
2026-07-24 17:19:56 +02:00
->toHaveSuffix('Exception');
arch('port repository interfaces have Repository suffix')
2026-07-24 17:19:56 +02:00
->expect('Domain\\Ports\\Repositories')
->interfaces()
2026-07-24 17:19:56 +02:00
->toHaveSuffix('Repository');
arch('use case inputs are named Input')
->expect('Application\\UseCases')
->classes()
->implementing(Input::class)
->toHaveSuffix('Input');
2026-07-24 17:19:56 +02:00
});