PHPstorm PHPunit code co coverage(PHPstorm PHPunit 代码共同覆盖)
问题描述
When I run my test suite in PHPstorm, the code coverage comes back with 0% for everything (which I know is not true), and when I run PHPunit from the command line, the logged HTML output documents show that I actually DO have coverage and lists all the detailed information.
In PHPstorm, I have my PHP interpreter set to /usr/local/bin/php (PHP 5.6.7) and xdebug 2.3.2 (screenshot: https://dl.dropboxusercontent.com/u/379071/Screen%20Shot%202015-04-20%20at%206.57.39%20PM.png). In my PHPunit preferences, I have the 'path to script' set to my composer autoload.php file. In my runtime configuration, I have a PHPunit runtime set to run with a 'defined configuration file' (See below). When I run, all the tests run and pass (a failure shows a stack trace), but the code coverage is completely zero for everything.
Any help would be greatly appreciated. I'm sure I've just missed something.
Contents of my XML configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
colors="true">
<testsuites>
<testsuite>
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./log/codeCoverage" charset="UTF-8"
yui="true" highlight="true"
lowUpperBound="50" highLowerBound="80"/>
<log type="testdox-html" target="./log/testdox.html"/>
</logging>
</phpunit>
I know this is an old thread but I just encountered this issue. In my case the project path contained a symlink to a different hd. By changing the project root to the absolute path (/media/hdd/...) I was able to resolve the problem.
这篇关于PHPstorm PHPunit 代码共同覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHPstorm PHPunit 代码共同覆盖
基础教程推荐
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01