Adil Abbasi
Adil Abbasi

Reputation: 3291

phpunit generate coverage report in html format for specific folder only

I want to generate coverhtml for my classes only currently I am using command like,

    phpunit --coverage-html=../../coverage ../../test/assertion.php

but it is testing the code in the vendor folder as well.

Upvotes: 4

Views: 1803

Answers (1)

Steven Scott
Steven Scott

Reputation: 11250

Using the XML file, you can include the directories you want to process, and exclude the ones you do not.

<filter>
    <whitelist processUncoveredFilesFromWhitelist="true">
        <directory suffix=".class">.</directory>
        <directory suffix=".fn">.</directory>
        <directory suffix=".php">.</directory>
        <exclude>
            <directory>ExternalLibraries</directory>
        </exclude>
    </whitelist>
</filter>

Upvotes: 2

Related Questions