diff --git a/src/generator/enricher/phpunit/PHPUnit.php b/src/generator/enricher/phpunit/PHPUnit.php index 6d067978..5d2d3e87 100644 --- a/src/generator/enricher/phpunit/PHPUnit.php +++ b/src/generator/enricher/phpunit/PHPUnit.php @@ -132,6 +132,7 @@ private function loadXML($fname) { ); } $dom->registerNamespace('pu', self::XMLNS); + return $dom; } catch (fDOMException $e) { throw new EnricherException( @@ -148,8 +149,9 @@ private function processUnit(fDOMDocument $unit, fDOMDocument $coverage) { $classNamespace = $unit->documentElement->getAttribute('namespace'); $classNode = $coverage->queryOne( - sprintf('//pu:class[@name = "%s" and pu:namespace[@name = "%s"]]', $className, $classNamespace) + sprintf('//pu:class[@name = "%2$s\%1$s" or (@name = "%1$s" and pu:namespace[@name = "%2$s"])]', $className, $classNamespace) ); + if (!$classNode) { // This class seems to be newer than the last phpunit run return;