Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

php - 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:wampwwwreningPHPUnitSymfony2.8inphpunit.bat" "--colors" "--log-junit" "C:UserschinyAppDataLocalTemp b-phpunit-log.xml" "--coverage-clover" "C:UserschinyAppDataLocalTemp b-phpunit-coverage.xml" "C:Program FilesNetBeans 8.1phpphpunitNetBeansSuite.php" "--" "--run=C:wampwwwreningPHPUnitSymfony2.8srcTreningBundleTestsControllerRabarbarControllerTest.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)

xdebug conf (C:wampinapacheapache2.4.17inphp.ini):

[xdebug]
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"
xdebug.show_local_vars=0

loaded extensions wamp. loaded extension

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

question from:https://stackoverflow.com/questions/37270837/phpunit-error-no-code-coverage-driver-is-available-having-xdebug-installed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

wampmanager->PHP->php.ini

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

wampinphpphp{version}php.ini

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

NOTE

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...