title: PHPUnit reports different code coverage % for the same test when run in isolation
body: <p>First, let me say that I've been through <a href="https://stackoverflow.com/questions/8804095/reaching-100-code-coverage-with-phpunit">Reaching 100% Code Coverage with PHPUnit<sup><em>SO</em></sup></a> as well as <a href="https://stackoverflow.com/questions/7074022/how-to-get-100-code-coverage-with-phpunit">How to get 100% Code Coverage with PHPUnit<sup><em>SO</em></sup></a>. I've not been able to solve the issue with the aid of either.</p>
  
  <p>My problem is that PHPUnit is reporting a different code coverage % for the same test when run in isolation as compared to when the entire test suite is run. So, when I run only the specific test in question using <code>phpunit test/src/artax/UsesRequestTraitTest</code> I get the following coverage:</p>
  
  <p><img src="https://i.stack.imgur.com/ayanu.png" alt="enter image description here"></p>
  
  <p>However, if I run my full suite of tests using <code>phpunit</code> without specifying a specific test, I receive the following for the same file:</p>
  
  <p><img src="https://i.stack.imgur.com/OMUEQ.png" alt="enter image description here"></p>
  
  <p>Here's the source code for the test:</p>
  
  <pre><code>&lt;?php
  
  class UsesRequestTraitTest extends PHPUnit_Framework_TestCase
  {
    public function testIsInitiallyEmpty()
    {
      $traitObj = $this-&gt;getObjectForTrait('artax\UsesRequestTrait');
      $this-&gt;assertAttributeEmpty('request', $traitObj);
      return $traitObj;
    }
  
    /**
     * @depends testIsInitiallyEmpty
     * @covers artax\UsesRequestTrait::setRequest
     * @covers artax\UsesRequestTrait::getRequest
     */
    public function testSetterAssignsRequestProperty($traitObj)
    {
      $r = new artax\blocks\http\HttpRequest();
      $traitObj-&gt;setRequest($r);
      $this-&gt;assertEquals($r, $traitObj-&gt;getRequest());
    }
  }
  </code></pre>
  
  <p>If you paid attention you'll see that I'm testing a PHP5.4 trait. I'm using PHP5.4RC6 and the bleeding edge 2.2 xdebug trunk version because the release version of xdebug doesn't yet support PHP5.4.</p>
  
  <p>It's possible (likely?) that this is a bug in xdebug or phpunit that hasn't yet been worked out because of still-evolving support for the new PHP version, but I wanted to get other opinions before wasting the concerned parties' time with an unnecessary bug report. Does anyone have any idea what might cause this or how to correct it so my <strong>geek OCD doesn't drive me insane over this gap in 100% coverage?</strong></p>
  
  <p>P.S. Heres the actual graphical coverage report for the 60% coverage version. The lines shown as uncovered below are green (covered) when the test is run in isolation:</p>
  
  <p><img src="https://i.stack.imgur.com/GIWg2.png" alt="enter image description here"></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've also tried adding <code>@covers</code> annotations for the trait methods to tests of concrete classes that <code>use</code> the trait, but this has not helped either ...</p>