25

I'm getting an error when I try to run tests using the --coverage flag.


Input

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

Output

[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/index.php

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

Versions

PHP: 5.5.12
Xdebug: 2.5.0
Codeception: 2.0.7

Thanks for any help!

J

jastew
  • 323
  • 3
  • 9

1 Answers1

1
  1. go to phpunit.xml and make sure you have something like this in the file:

    < logging >
    < log type="coverage-html" target="./CodeCoverage/"/>
    < /logging >

  2. run this command:

    $ phpunit --coverage-html ./report

  3. now check go to the directory and open the html file.

Mahmoud Zalt
  • 30,478
  • 7
  • 87
  • 83