Sruj_2ndAccountForStupidQtions Sruj_2ndAccountForStupidQtions - 2 years ago 2025
PHP Question

PHPUnit. Error: No code coverage driver is available. (having xdebug installed)

There is an answer for similar question Laravel 5: PHPUnit and no code coverage driver available that works, but i have xdebug installed.

(if this matter I'm using: windows7, netbeans8.1, php7, wamp3)

Displaying code coverage in Netbeans result in:

Error: No code coverage driver is available

and the output is below:

"C:\wamp\www\treningPHPUnitSymfony2.8\bin\phpunit.bat" "--colors"
"--log-junit" "C:\Users\chiny\AppData\Local\Temp\nb-phpunit-log.xml"
"C:\Program Files\NetBeans 8.1\php\phpunit\NetBeansSuite.php" "--"
PHPUnit 5.3.4 by Sebastian Bergmann and contributors.

Error: No code coverage driver is available

.II 3 /
3 (100%)

Time: 1.13 seconds, Memory: 4.00MB

OK, but incomplete, skipped, or risky tests! Tests: 3, Assertions: 1,
Incomplete: 2. Done.](url)

installed packages:

doctrine/annotations v1.2.7
doctrine/cache v1.6.0
doctrine/collections v1.3.0
doctrine/common v2.6.1
doctrine/dbal v2.5.4
doctrine/doctrine-bundle 1.6.2
doctrine/doctrine-cache-bundle 1.3.0
doctrine/inflector v1.1.0
doctrine/instantiator 1.0.5
doctrine/lexer v1.0.1
doctrine/orm v2.5.4
incenteev/composer-parameter-handler v2.1.2
ircmaxell/password-compat v1.0.4
jdorn/sql-formatter v1.2.17
monolog/monolog 1.19.0
myclabs/deep-copy 1.5.1
paragonie/random_compat v1.4.1
phpdocumentor/reflection-docblock 2.0.4
phpspec/prophecy v1.6.0
phpunit/php-code-coverage 3.3.1
phpunit/php-file-iterator 1.4.1
phpunit/php-text-template 1.2.1
phpunit/php-timer 1.0.8
phpunit/php-token-stream 1.4.8
phpunit/phpunit 5.3.4
phpunit/phpunit-mock-objects 3.1.3
phpunit/phpunit-skeleton-generator 2.0.1
psr/log 1.0.0
sebastian/code-unit-reverse-lookup 1.0.0
sebastian/comparator 1.2.0
sebastian/diff 1.4.1
sebastian/environment 1.3.6
sebastian/exporter 1.2.1
sebastian/global-state 1.1.1
sebastian/object-enumerator 1.0.0
sebastian/recursion-context 1.0.2
sebastian/resource-operations 1.0.0
sebastian/version 1.0.6
sensio/distribution-bundle v5.0.6
sensio/framework-extra-bundle v3.0.16
sensio/generator-bundle v3.0.6
sensiolabs/security-checker v3.0.2
swiftmailer/swiftmailer v5.4.2
symfony/monolog-bundle 2.11.1
symfony/phpunit-bridge v2.8.6
symfony/polyfill-apcu v1.1.1
symfony/polyfill-intl-icu v1.1.1
symfony/polyfill-mbstring v1.1.1
symfony/polyfill-php54 v1.1.1
symfony/polyfill-php55 v1.1.1
symfony/polyfill-php56 v1.1.1
symfony/polyfill-php70 v1.1.1
symfony/polyfill-util v1.1.1
symfony/security-acl v3.0.0
symfony/swiftmailer-bundle v2.3.11
symfony/symfony v2.8.6
twig/twig v1.24.0

xdebug conf (C:\wamp\bin\apache\apache2.4.17\bin\php.ini):

zend_extension ="C:/wamp/bin/php/php7.0.1/zend_ext/php_xdebug-2.4.0rc3-7.0-vc14.dll"

xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="C:/wamp/tmp"

loaded extensions
wamp. loaded extension

(I have netbeans and project directory in same Windows partition)

Answer Source

There are 2 php.ini files in most Apache/PHP installations and definitely in WAMPServer

To amend the correct php.ini used by PHP in Apache use the menus


But for the php.ini file used by the PHP CLI you have to manually edit


the result of a php -v should look like this if XDEBUG is configured in the CLI

php -v
PHP 7.0.6 (cli) (built: Apr 27 2016 14:00:40) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans


The current WAMPServer 3 is 3.0.4 ADDON upgrades can be found on SourceForge

The latest ADDON PHP Version is PHP7.0.6 also available on SourceForge

See The WampServer Forum to keep up to date with the latest releases of PHP / MYSQL / Apache ADDONS for WAMPServer 3

Also :

You may find that you have to tweek the XDEBUG config parameters in the php.ini to suit your specific needs

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download