ldc-arcadia-api/tests/Architecture/CodingStandardsTest.php
Jérémy Munsch 43a568ef5a
refactor(employees): replace native assert with Webmozart\Assert
Updated assertions in FindEmployee, FindAllEmployees, and Output classes
to use Webmozart\Assert for better type safety and consistency.
2026-08-12 16:56:13 +02:00

61 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
describe('Coding Standards & Project Rules', function (): void {
arch()->preset()->php();
// Le helper assert natif est interdit en faveur de Webmozart\Assert
arch()->preset()->security();
arch('assert is not used in src (use Webmozart\Assert instead)')
->expect('assert')
->not->toBeUsed();
arch('config() helper is not used in src (use Config facade instead)')
->expect('config')
->not->toBeUsed();
arch('env() helper is not used in src (use Config facade instead)')
->expect('env')
->not->toBeUsed();
arch('debug functions are not used in src')
->expect(['dd', 'dump', 'var_dump', 'die', 'print_r', 'ray'])
->not->toBeUsed();
arch('shell execution functions are not used in src')
->expect(['exec', 'shell_exec', 'system', 'passthru', 'proc_open'])
->not->toBeUsed();
arch('eval function is not used in src')
->expect('eval')
->not->toBeUsed();
arch('insecure hashing functions are not used in src')
->expect(['md5', 'sha1'])
->not->toBeUsed();
arch('sleep functions are not used in src')
->expect(['sleep', 'usleep'])
->not->toBeUsed();
arch('all Domain source files use strict types')
->expect('Domain')
->toUseStrictTypes();
arch('all Application source files use strict types')
->expect('Application')
->toUseStrictTypes();
arch('all Presentation source files use strict types')
->expect('Presentation')
->toUseStrictTypes();
arch('all Infra source files use strict types')
->expect('Infra')
->toUseStrictTypes();
arch('all Shared source files use strict types')
->expect('Shared')
->toUseStrictTypes();
});