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

9
  • 1
    is project.local set in your hosts file? Commented Dec 22, 2014 at 17:15
  • Where is your code that uses file_get_contents? Commented Dec 22, 2014 at 17:16
  • What is the URL can I go to in order to see the page? Commented Dec 22, 2014 at 17:24
  • @donald123 yeah it is set. The site works and I can acceptance tests no problem, it's just code coverage that won't work Commented Dec 22, 2014 at 17:30
  • @13375 The site is running locally at the moment using an Apache server Commented Dec 22, 2014 at 17:34

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Are you sure this fixes what the question author asks for?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.