First, let me say that I've been through Reaching 100% Code Coverage with PHPUnitSO as well as How to get 100% Code Coverage with PHPUnitSO. I've not been able to solve the issue with the aid of either.
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 phpunit test/src/artax/UsesRequestTraitTest I get the following coverage:

However, if I run my full suite of tests using phpunit without specifying a specific test, I receive the following for the same file:

Here's the source code for the test:
<?php
class UsesRequestTraitTest extends PHPUnit_Framework_TestCase
{
public function testIsInitiallyEmpty()
{
$traitObj = $this->getObjectForTrait('artax\UsesRequestTrait');
$this->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->setRequest($r);
$this->assertEquals($r, $traitObj->getRequest());
}
}
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.
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 geek OCD doesn't drive me insane over this gap in 100% coverage?
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:

UPDATE
I've also tried adding @covers annotations for the trait methods to tests of concrete classes that use the trait, but this has not helped either ...
$request) ... what's really strange is that there are two other trait files in the same format with the same tests where the full test suite reports the coverage correctly. I've looked over and over for the difference in the tests that would cause one to report correctly while another does not, but to no avail. - rdlowreygetObjectForTraitmethod and have posted an answer describing the fix, if you're interested. - rdlowrey