Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8313049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:22:06+00:00 2026-06-08T20:22:06+00:00

We are struggling to get desired results from the coverage report using phpunit. Previously,

  • 0

We are struggling to get desired results from the coverage report using phpunit.

Previously, we were only capturing code coverage for files that had unit tests associated with them (I believe this is the default setting When the whitelist is empty).

Now we would like to have a coverage report which includes our already tested files, along with one or two specific directories (which have files with 0% coverage). This should give us more realistic statistics.

We have used an xml configuration file to try and accomplish this:

<filter>
    <whitelist processUncoveredFilesFromWhitelist="true">
        <directory suffix=".php">php/lib/</directory>
    </whitelist>
    <blacklist>
        <directory suffix=".php">/usr/share/php/SymfonyComponents/YAML</directory>
    </blacklist>
</filter>

However, this config now only includes coverage report for that one specified directory in our whitelist. It is not capturing coverage for other files which we have written unit tests for.

How do I achieve a code coverage configuration which captures coverage for:

1) all files that already have unit tests associated with them

2) Other configurable directories

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:22:09+00:00Added an answer on June 8, 2026 at 8:22 pm

    The following is an example of what we use to cover directories not covered by our tests. The section covers the application. We have different file extensions so the directory suffix examples are included for you as well.

    <!-- Add files not covered with tests into Code Coverage Analysis -->
    <filter>
        <whitelist addUncoveredFilesFromWhitelist="true">
            <directory suffix=".class">.</directory>
            <directory suffix=".fn">.</directory>
            <directory suffix=".php">lib/UTIL</directory>
    
            <exclude>
                <file>lib/UTIL/AJAX.class</file>
                <file>lib/UTIL/GetDump.fn</file>
                <directory>ExternalLibraries</directory>
            </exclude>
        </whitelist>
    </filter>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: Been struggling to get my code to load external shaders and it is
Im really struggling to get my head round this. Im using c#. I want
I am struggling to get preg_match to return only the image URL and not
I am struggling to get a list created by Ember.js sortable using jQuery.ui. The
I'm struggling to get offline files working in Chrome. The first view of the
I'm struggling to get my head around XML namespace query when using XML nodes
I'm struggling to produce the same behavior in web service code that uses Deferred
I'm struggling to get around the 404 errors from asp.net mvc beta when deploying
I'm still struggling to get my sample code working on a 64 bit machine.
I am currently struggling to get the following code to compile. First the header

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.