LeMike
LeMike

Reputation: 3295

phpUnit code coverage on interfaces shows no success

Currently I am doing a whitebox test so the parent class and all interfaces are tested. This covers them all so I add the doc comment:

/**
 * @covers \Pat\Environment\PHP\Autoloader\Psr0<extended>
 */
public function testWhitebox() {}

phpUnit runs with success but the interface does not appear in the coverage.xml file. No matter if excluded or not.

<?xml version="1.0" encoding="UTF-8" ?>
<phpunit bootstrap="bootstrap.php">
    <filter>
        <blacklist>
            <file>*Interface.php</file>
        </blacklist>
    </filter>

    <logging>
        <log type="coverage-clover" target="./coverage.xml"/>
    </logging>
</phpunit>

The phpStorm IDE keeps counting it as file and therefor it is missing. Without that issue it would be 100% code coverage.

Code coverage in phpStorm

It is open for phpStorm and fixed for IntelliJ IDEA.

http://youtrack.jetbrains.com/issue/WI-14785

Any known workaround?

Upvotes: 2

Views: 1023

Answers (1)

hakre
hakre

Reputation: 198214

How to fix that?

If this qualifies as a bug/flaw/new feature request in PHPStorm, you can report it as an issue in their issue tracker for PHPStorm (and other products).

Their personnel will then take care to fix that.


If you do not want to go that route, you can just ignore the file in your code-coverage statistics because you don't need to take it into account when calculating the percentage.

Upvotes: 2

Related Questions