Paupoo's avatar
Level 1

ERROR Code coverage driver not available.

Hello,

I've tried reading many forums, official doc in vain. It must be stupid (I'm a self learning rookie) but I don't find the root cause.

I'm trying to analyse my test cases (learning this wonderful world so far) and discovered the coverage feature. But every time I run it, I got this error message :

php artisan test --coverage

ERROR Code coverage driver not available. Did you set Xdebug's coverage mode?

I can run test without the "--coverage" attributes.

To make sure Xdebug is correctly installed (I'm working on Fedora) I've done a php -v and I see xdebug.

php -v PHP 8.3.10 (cli) (built: Jul 30 2024 13:44:37) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.3.10, Copyright (c) Zend Technologies with Zend OPcache v8.3.10, Copyright (c), by Zend Technologies with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans

Then I've check my php.ini file into /etc/php.ini and added

xdebug.mode = develop,debug,coverage (and many other stuffs in vain)

To be sure, I've booted on my wife's Windows PC, cloned my git, did it too and go the same issue. Still on Fedora, I've tried a fresh install from Laravel via composer and I get the same issue.

Now I'm totally lost and I'm wondering what I shall do to solve this, any idea ?

0 likes
2 replies
Paupoo's avatar
Level 1

Thanks @tray2

I indeed had to change the config not in the php.ini, but in the zend extension file directly.

63% of test coverage, now I know what to do ;) (back on the learning path)

Please or to participate in this conversation.