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

24 lines
679 B
PHP

<?php
declare(strict_types=1);
describe('coding standards', function (): void {
arch()->preset()->php();
arch()->preset()->security();
arch('all source files use strict types')
->expect(['Application', 'Domain', 'Shared'])
->toUseStrictTypes();
arch('no sleep functions in production code')
->expect(['sleep', 'usleep'])
->not->toBeUsed();
arch('no singletons in production code')
->expect(['getInstance', 'instance'])
->not->toBeUsed();
arch('no direct filesystem writes in domain or application')
->expect(['Application', 'Domain'])
->not->toUse(['file_put_contents', 'fopen']);
});