title: Force Exclude files from PHPUnit Code Coverage
body: <p>Is it possible to forcefully exclude a folder from PHPUnit's code coverage?</p>
  
  <p>Problem I've got is, that I have a Symfony 1.4 project, which has folders at <code>./lib/vendor/symfony/*</code>. I want to exclude anything that's inside <code>./lib/vendor/*</code> - recursively.</p>
  
  <p>Now, I want to exclude them whether they were covered implicitly by my tests or not, i.e. I never want to see these folders. So, I've added this bit to my <code>phpunit.xml</code> config file, but it doesn't seem to exclude these folders, no matter what I do:</p>
  
  <pre><code>&lt;filter&gt;
      &lt;whitelist&gt;
          &lt;exclude&gt;
              &lt;directory&gt;./lib/vendor/*&lt;/directory&gt;
              &lt;directory&gt;./lib/vendor/symfony/lib/*&lt;/directory&gt;
          &lt;/exclude&gt;
      &lt;/whitelist&gt;
  &lt;/filter&gt;
  </code></pre>
  
  <p>It appears to me the moment code gets hit and XDebug notices it, PHPUnit will include it in the code coverage no matter what. The downside for me with this is, that this code is already tested by Symfony developers, so no need to include it in my coverage report, messing up my numbers :P</p>