Laravel 9 has a new feature added by Nuno Maduro to get a code coverage for specific Laravel projects, the command is php artisan test --coverage, in this article I am going to explain how to set xdebug locally in a MacOS environment. You should be able to see the php version, but also more data like xdebug version installed locally, like this: https://res.cloudinary.com/practicaldev/image/fetch/s--toCduLb---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qtrosu2w4vujpt2zqzc5.png

Then to check the php.ini file location (it changes from different php versions) run this command: php --ini

Grab the file location and edit the php.ini file: // Command to open files with vscode... it is easier code /usr/local/etc/php/8.0/php.ini // or nano /usr/local/etc/php/8.0/php.ini

You can customize even more the coverage tags, but at this point your code coverage is higher.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners