使用 phpunit 运行 ant 崩溃
Posted
技术标签:
【中文标题】使用 phpunit 运行 ant 崩溃【英文标题】:Running ant with phpunit crashes 【发布时间】:2016-12-08 12:52:10 【问题描述】:我正在尝试同时使用 ant 和 phpunit,但我收到一个错误,即 phpunit 已崩溃但构建成功。这是一个流明框架
MacBook-Pro:test-api test$ ant phpunit
Buildfile: /Users/test/Code/test-api/build.xml
phpunit:
[exec]
[exec] Running phpunit in 4 processes with /Users/test/Code/test-api/vendor/bin/phpunit
[exec]
[exec] Configuration read from /Users/test/Code/test-api/phpunit.xml
[exec]
[exec]
[exec]
[exec] [RuntimeException]
[exec] Coverage file /private/var/folders/jp/qjjd9lr50z74kbj_gwcc3bsr0000gn/T/CV_LaTe66 is empty. This means a PHPUnit process has crashed.
[exec]
[exec]
[exec] paratest [-p|--processes PROCESSES] [-f|--functional] [--no-test-tokens] [-h|--help] [--coverage-clover COVERAGE-CLOVER] [--coverage-html COVERAGE-HTML] [--coverage-php COVERAGE-PHP] [-m|--max-batch-size MAX-BATCH-SIZE] [--filter FILTER] [--whitelist WHITELIST] [--phpunit PHPUNIT] [--runner RUNNER] [--bootstrap BOOTSTRAP] [-c|--configuration CONFIGURATION] [-g|--group GROUP] [--exclude-group EXCLUDE-GROUP] [--stop-on-failure] [--log-junit LOG-JUNIT] [--colors] [--testsuite [TESTSUITE]] [--path PATH] [--] [<path>]
[exec]
[exec] Result: 1
BUILD SUCCESSFUL
Total time: 1 second
【问题讨论】:
【参考方案1】:实际上,我们可以在没有ant
和单独使用phpunit
的情况下做到这一点。
我们只需要运行phpunit --coverage-text
或phpunit --coverage-html <dir>
【讨论】:
以上是关于使用 phpunit 运行 ant 崩溃的主要内容,如果未能解决你的问题,请参考以下文章
我无法使用 phpunit 进行测试:无法打开文件“autoload.php”
Composer 更新 codeception - phpunit 不更新
Composer 无法更新或安装 PHPUnit/php-code-coverage
markdown [代码覆盖率Phpunit]安装Xdebug并使用Phpunit运行代码覆盖率#xdebug #phpunit #code #coverage