admin管理员组文章数量:1389777
Where should I check for the code coverage stats when using PHPUnit for WordPress?
My WordPress setup:
I have setup WordPress using VVV and my testing suite includes PHPUnit and WP-CLI.
How I executed test cases to find code coverage?
When I execute phpunit
command to test a WordPress plugin, I'm able to see, if the test cases passed or failed. In my case there were no failures.
To find the code coverage, I executed phpunit --coverage-text=./coverage.txt
, the test cases passed but I'm unable to find the coverage.txt file to check the actual code coverage stats.
A search for coverage.txt
file in plugin's folder using the Windows explorer returned no results. Am I missing something?
Where should I check for the code coverage stats when using PHPUnit for WordPress?
My WordPress setup:
I have setup WordPress using VVV and my testing suite includes PHPUnit and WP-CLI.
How I executed test cases to find code coverage?
When I execute phpunit
command to test a WordPress plugin, I'm able to see, if the test cases passed or failed. In my case there were no failures.
To find the code coverage, I executed phpunit --coverage-text=./coverage.txt
, the test cases passed but I'm unable to find the coverage.txt file to check the actual code coverage stats.
A search for coverage.txt
file in plugin's folder using the Windows explorer returned no results. Am I missing something?
1 Answer
Reset to default 0You may not have the xdebug PHP extension enabled. When I run the tests without xdebug enabled on PHPUnit 4.8.26, I get this message:
Warning: The Xdebug extension is not loaded
No code coverage will be generated.
It looks like VVV comes with xdebug though, so it is probably enabled by default. But perhaps you disabled it somehow?
To check if xdebug is enabled you can run php --ri xdebug
. That should show you the xdebug settings, if the extension is currently enabled.
If the extension is enabled, then maybe you haven't configured a whitelist
within your configuration file. Take a look at those docs if you haven't already, as they outline the steps needed to generate code coverage data with PHPUnit.
本文标签: pluginsUnable to find PHPUnit code coverage stats
版权声明:本文标题:plugins - Unable to find PHPUnit code coverage stats 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744643482a2617257.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论