Code Coverage
Coverage reports show which lines are executed by tests. Run with Xdebug or PCOV — aim for meaningful coverage, not 100% for its own sake.
Coverage reports show which lines are executed by tests. Run with Xdebug or PCOV — aim for meaningful coverage, not 100% for its own sake.
# Run with coverage (requires Xdebug or PCOV)
./vendor/bin/phpunit --coverage-html coverage/
php artisan test --coverage
# Coverage configuration in phpunit.xml
<coverage>
<include>
<directory>app/</directory>
</include>
</coverage>
# Pest coverage
./vendor/bin/pest --coverage --min=80
Focus coverage on business logic and edge cases — trivial getters and framework glue rarely need it.