private function getRelativePath(\SimpleXMLElement $fileName)
    {
        $dirOfSrcFiles = $this->element->project->directory["name"];
        $projectRoot = $this->rootDir;
        // Need to cut off everything lower than projectRoot
        $dirFromProjectRoot = substr($dirOfSrcFiles, strlen($projectRoot) + 1);
        // remove .xml and convert to string
        $relativeFilePath = substr((string)$fileName, 0, -4);
        return join(DIRECTORY_SEPARATOR, array($dirFromProjectRoot, $relativeFilePath));
    }
private function getRelativePath(\SimpleXMLElement $fileName)
    {
        $dirOfSrcFiles = $this->element->project->directory["name"];
        $projectRoot = $this->rootDir;
        // Need to cut off everything lower than projectRoot
        $dirFromProjectRoot = substr($dirOfSrcFiles, strlen($projectRoot) + 1);
        // remove .xml and convert to string
        $relativeFilePath = substr((string)$fileName, 0, -4);
        return join(DIRECTORY_SEPARATOR, array($dirFromProjectRoot, $relativeFilePath));
    }
private function getRelativePath ( \ SimpleXMLElement $ fileName ) { $ dirOfSrcFiles = $ this -> element -> project -> directory [ "name" ] ; $ projectRoot = $ this -> rootDir ; // Need to cut off everything lower than projectRoot $ dirFromProjectRoot = substr ( $ dirOfSrcFiles , strlen ( $ projectRoot ) + 1 ) ; // remove .xml and convert to string $ relativeFilePath = substr ( ( string ) $ fileName , 0 , - 4 ) ; return join ( DIRECTORY_SEPARATOR , array ( $ dirFromProjectRoot , $ relativeFilePath ) ) ; }
The PhpUnit XML Coverage format does not save the full path of the filename
We can get the filename by combining the path of the first directory with
the href attribute of each file.
@param \SimpleXMLElement $fileName The href attribute of the <file></file> node.
@return string The relative path of the file, that is, relative to project root.
The PhpUnit XML Coverage format does not save the full path of the filename We can get the filename by combining the path of the first directory with the href attribute of each file .