61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Architecture;
|
|
|
|
use Shared\Filesystem\TemporaryFileFactory;
|
|
|
|
// Coding standards
|
|
arch()->preset()->php();
|
|
arch()->preset()->security()->ignoring([
|
|
TemporaryFileFactory::class,
|
|
]);
|
|
|
|
arch('it has no shell execution functions are used')
|
|
->expect(['exec', 'shell_exec', 'system', 'passthru', 'proc_open'])
|
|
->not->toBeUsed();
|
|
|
|
arch('it has no eval usage')
|
|
->expect(['eval'])
|
|
->not->toBeUsed();
|
|
|
|
arch('it has no dangerous file functions')
|
|
->expect(['file_get_contents', 'file_put_contents', 'fopen'])
|
|
->not->toBeUsed();
|
|
|
|
arch('it has no globals are used')
|
|
->expect(['$GLOBALS', 'global'])
|
|
->not->toBeUsed();
|
|
|
|
arch('it has no singletons')
|
|
->expect(['getInstance', 'instance'])
|
|
->not->toBeUsed();
|
|
|
|
arch('it has no insecure hashing')
|
|
->expect(['md5', 'sha1'])
|
|
->not->toBeUsed();
|
|
|
|
arch('it has no sleep function are used')
|
|
->expect(['sleep', 'usleep'])
|
|
->not->toBeUsed();
|
|
|
|
arch('it has no debug globals are used')
|
|
->expect(['var_dump', 'die', 'print_r'])
|
|
->not->toBeUsed();
|
|
|
|
arch('all app source files use strict types')
|
|
->expect('App')
|
|
->toUseStrictTypes();
|
|
|
|
arch('all domain source files use strict types')
|
|
->expect('Domain')
|
|
->toUseStrictTypes();
|
|
|
|
arch('all shared source files use strict types')
|
|
->expect('Shared')
|
|
->toUseStrictTypes();
|
|
|
|
arch('all infrastructure source files use strict types')
|
|
->expect('Infrastructure')
|
|
->toUseStrictTypes();
|