test(arch): add architecture test suite for Shared layer
This commit is contained in:
parent
3d4302b49c
commit
2b7a8b4b99
1 changed files with 65 additions and 0 deletions
65
tests/Architecture/SharedTest.php
Normal file
65
tests/Architecture/SharedTest.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Architecture;
|
||||
|
||||
describe('Shared Architecture Rules', function (): void {
|
||||
arch('Shared layer does not depend on Domain, Application, Presentation, Infra, or App')
|
||||
->expect('Shared')
|
||||
->not->toUse([
|
||||
'Domain',
|
||||
'Application',
|
||||
'Presentation',
|
||||
'Infra',
|
||||
'Infrastructure',
|
||||
'App',
|
||||
]);
|
||||
|
||||
arch('Shared layer does not depend on Illuminate or Symfony frameworks')
|
||||
->expect('Shared')
|
||||
->not->toUse([
|
||||
'Illuminate',
|
||||
'Symfony',
|
||||
]);
|
||||
|
||||
arch('Shared layer does not use Laravel helper functions')
|
||||
->expect('Shared')
|
||||
->not->toUse([
|
||||
'abort',
|
||||
'app',
|
||||
'auth',
|
||||
'asset',
|
||||
'back',
|
||||
'bcrypt',
|
||||
'broadcast',
|
||||
'cache',
|
||||
'config',
|
||||
'cookie',
|
||||
'csrf_token',
|
||||
'dd',
|
||||
'dump',
|
||||
'decrypt',
|
||||
'dispatch',
|
||||
'event',
|
||||
'factory',
|
||||
'logger',
|
||||
'redirect',
|
||||
'request',
|
||||
'response',
|
||||
'route',
|
||||
'session',
|
||||
'storage',
|
||||
'url',
|
||||
'throw_if',
|
||||
'throw_unless',
|
||||
'__',
|
||||
'trans',
|
||||
'trans_choice',
|
||||
'view',
|
||||
]);
|
||||
|
||||
arch('Shared layer uses strict types')
|
||||
->expect('Shared')
|
||||
->toUseStrictTypes();
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue