gpt4 book ai didi

php - phing 与 phpunit codecoverage 结果

转载 作者:行者123 更新时间:2023-12-04 00:33:04 25 4
gpt4 key购买 nike

我已经为 phing 创建了一个 build.xml 文件来创建代码覆盖率报告。它使用

phpunit codecoverage="true"

并指向与 phpunit --coverage-html 相同的文件。然而,结果不同。使用 phing,我对所有文件都有 100% 的代码覆盖率,但我没有。可能有一些我不知道的关于使用 phing 运行代码覆盖率的解释 100%。我做错了什么以获得不同的结果?

最佳答案

您可以尝试将 phpunit 作为可执行文件运行,并将 --coverage-html 作为参数运行(我们就是这样做的,而且似乎运行良好)。

例子:

<target name="phpunit">
<exec executable="phpunit" dir="${basedir}/source" failonerror="on">
<arg line="--log-junit ${basedir}/build/logs/phpunit.xml
--coverage-clover ${basedir}/build/logs/phpunit.coverage.xml
--coverage-html ${basedir}/build/coverage
tests/" />
</exec>
</target>

关于php - phing 与 phpunit codecoverage 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2283766/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com