feature - 8 - Add code coverage

This commit is contained in:
myrmidex 2026-01-03 21:17:00 +01:00
parent b93e6cb832
commit 2ed9dfbdaa
4 changed files with 29 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
/composer.lock
/.phpunit.cache
/coverage
/node_modules
/public/build
/public/hot

View file

@ -72,6 +72,10 @@ # Database
make seed # Seed database
make fresh # Fresh migrate with seeds
# Testing
make test # Run tests
composer test:coverage-html # Run tests with coverage report (generates coverage/index.html)
# Utilities
make shell # Enter app container
make db-shell # Enter database shell

View file

@ -57,6 +57,17 @@
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
],
"test": [
"@php artisan test"
],
"test:coverage": [
"Composer\\Config::disableProcessTimeout",
"@php -d xdebug.mode=coverage artisan test --coverage"
],
"test:coverage-html": [
"Composer\\Config::disableProcessTimeout",
"@php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-html coverage --coverage-text"
]
},
"extra": {

View file

@ -15,8 +15,21 @@
<source>
<include>
<directory>app</directory>
<directory>src</directory>
</include>
<exclude>
<directory>app/Console</directory>
<directory>app/Exceptions</directory>
<directory>app/Providers</directory>
</exclude>
</source>
<coverage>
<report>
<html outputDirectory="coverage"/>
<text outputFile="coverage/coverage.txt" showOnlySummary="true"/>
<clover outputFile="coverage/clover.xml"/>
</report>
</coverage>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>