无法运行代码覆盖率的代码接收测试

2022-08-30 17:18:01

当我尝试使用 --coverage 标志运行测试时,我收到错误。


输入

php codecept.phar run acceptance testCest.php --coverage

输出

[ErrorException] file_get_contents(http://project.local/c3/report/clear): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

codeception.yml

coverage:
    remote: false
    enabled: true
    include:
        - application/*

public_html/索引.php

<?php require __DIR__.'/../c3.php'; ?>

版本

PHP: 5.5.12
Xdebug: 2.5.0
Codeception: 2.0.7

感谢您的任何帮助!

J


答案 1
  1. 转到并确保文件中有类似内容:phpunit.xml

    <日志记录>
    <日志类型=“coverage-html” target=“./CodeCoverage/”/>
    < /logging >

  2. 运行以下命令:

    $ phpunit --coverage-html ./report

  3. 现在检查转到目录并打开html文件。


答案 2

推荐