0

Well, I have a problem trying to setup code coverage reports. First thing I had to do was to install xdebug, I did it, and it worked...Well, actually, instead of showing me the coverage of my test code it shows a couple of files inside of PHPUnit module's directory, and some other strange files from framework's system directory such as:

C:/xampp/htdocs/.../src/modules/Unittest/classes/kohana/unittest/helpers.php
C:/xampp/htdocs/.../src/modules/Unittest/classes/unittest/helpers.php
C:/xampp/htdocs/.../src/system/classes/kohana/config.php

Another problem is that the coverage files that should be html reports which are created with every "phpunit" command executed are always saved to the C:// directory. I tried to change it in xdebug settings in php.ini, but none worked.

Does anybody knows what could be the reason?
I'm using Jenkins if this is any helpful info.
And please tell me if you need more info.

Thanks.

1 Answer 1

1
 C:/xampp/htdocs/.../src/modules/Unittest/classes/kohana/unittest/helpers.php
 C:/xampp/htdocs/.../src/modules/Unittest/classes/unittest/helpers.php
 C:/xampp/htdocs/.../src/system/classes/kohana/config.php

These files seem like test helpers and config. PHPUnit will generate code coverage for every file that doesn't just contain unit tests.

If you don't want these files to show up use excludes in your phpunit.xml file

  <whitelist addUncoveredFilesFromWhitelist="true">
    <directory suffix=".php">src</directory>
    <exclude>
      <directory suffix=".php">tests</directory>
      <file>src/system/classes/kohana/config.php</file>
    </exclude>
  </whitelist>

To answer the second question we'd need to see how you run the tests and your phpunit.xml.

For later please consider putting only one answerable question per "question" you open up. As this is not a forum and each question should be one solved issue it's easier to get answers for your stuff :)

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

Comments

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.