Update arch tests

This commit is contained in:
philipp lang 2024-10-25 00:39:03 +02:00
parent 131061a3ee
commit 56090b0104
4 changed files with 90 additions and 2 deletions

View File

@ -86,7 +86,8 @@
"mockery/mockery": "^1.4.4",
"orchestra/testbench": "^9.0",
"pestphp/pest": "^3.0",
"phpstan/phpstan-mockery": "^2.0"
"phpstan/phpstan-mockery": "^2.0",
"qossmic/deptrac": "^2.0"
},
"config": {
"optimize-autoloader": true,
@ -121,6 +122,10 @@
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"archtest": [
"./vendor/bin/deptrac analyze",
"./vendor/bin/pest tests/Arch.php"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"

50
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7ea50eebeb73984c5cf66105fc42e50b",
"content-hash": "65ea356f4d9ce066e39c9914f823db01",
"packages": [
{
"name": "amphp/amp",
@ -15724,6 +15724,54 @@
},
"time": "2024-10-14T03:18:12+00:00"
},
{
"name": "qossmic/deptrac",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/qossmic/deptrac.git",
"reference": "a6dbfaf4f20f0ae98b766954f35b8c164c3063ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qossmic/deptrac/zipball/a6dbfaf4f20f0ae98b766954f35b8c164c3063ed",
"reference": "a6dbfaf4f20f0ae98b766954f35b8c164c3063ed",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^8.1"
},
"suggest": {
"ext-dom": "For using the JUnit output formatter"
},
"bin": [
"bin/deptrac",
"deptrac.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Qossmic\\Deptrac\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.",
"keywords": [
"static analysis"
],
"support": {
"source": "https://github.com/qossmic/deptrac/tree/2.0.4"
},
"abandoned": "deptrac/deptrac",
"time": "2024-11-21T22:38:34+00:00"
},
{
"name": "symfony/polyfill-php84",
"version": "v1.31.0",

30
deptrac.yaml Normal file
View File

@ -0,0 +1,30 @@
deptrac:
paths:
- ./app
- ./modules
exclude_files:
- '#.*Test.php$#'
layers:
- name: AppFiles
collectors:
- type: bool
must:
- type: classLike
value: .*
- type: directory
value: app/.*
- name: ModuleFiles
collectors:
- type: bool
must:
- type: classLike
value: .*
- type: directory
value: modules/.*
ruleset:
ModuleFiles:
- AppFiles
AppFiles:
- ModuleFiles

View File

@ -4,3 +4,8 @@ arch()
->expect('App')
->not->toUse(['die', 'dd', 'dump'])
->not->toHaveFileSystemPermissions('0777');
arch()
->expect('Modules')
->not->toUse(['die', 'dd', 'dump'])
->not->toHaveFileSystemPermissions('0777');