Interfaces and empty classes in code coverage

Viewed 1269

I'm using PHPUnit 5.2.9, PHP 5.6.19 and Xdebug 2.4.0 (non RC) alongside netbeans IDE.

Like any other project, I make use of interfaces and the odd empty extended class. Since these files contain no executable code, why are they being listed in my code coverage reports? More than that, they are listed as 0% covered with 0/0 methods. (I'd be happy if that were 100% just to see less red)

I have tried excluding them within the phpunit.xml file:

<whitelist processUncoveredFilesFromWhitelist="false"> // true make no difference
    <directory suffix=".php">./Annotation</directory>
    <directory suffix=".php">./Cache</directory>
    <exclude>
        <directory suffix=".php">./*Interface</directory>
        <directory suffix=".php">./*/*Interface</directory>
    </exclude>
</whitelist>

But it appears globs (*) are only valid for directories. I can however use the <file> tag and exclude them individually. However, that's a lot of files to exclude when they shouldn't be included in the first place.

Am I doing something wrong or is this standard behaviour?

1 Answers
Related