我正在尝试设置phpunit来显示我的项目的代码覆盖率。我已经按照google上的示例进行了操作,基本上有以下设置:
composer.json
"require-dev": {
"phpunit/phpunit": "5.*",
"phpunit/php-code-coverage": "^4.0.4",
"mockery/mockery": "^0.9.9"
},
phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./app/tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">app/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./report/" charset="UTF-8"
yui="true" highlight="false"
lowUpperBound="50" highLowerBound="80"/>
</logging>
</phpunit>
当我在宅基地VM上运行所有测试时
vendor/phpunit/phpunit/phpunit
测试运行但是没有为&#34;报告&#34;生成代码覆盖率。目录。它仍然是空的。
我做错了什么?
答案 0 :(得分:0)
我刚刚发现跑步时发生致命错误。修复此问题后,生成了代码覆盖率报告。