diff --git a/src/Reports/Junit.php b/src/Reports/Junit.php index 0b59604ae0..b0cf520b7e 100644 --- a/src/Reports/Junit.php +++ b/src/Reports/Junit.php @@ -47,6 +47,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false, $out->startElement('testcase'); $out->writeAttribute('name', $report['filename']); + $out->writeAttribute('file', $report['filename']); $out->endElement(); } else { $failures = ($report['errors'] + $report['warnings']); @@ -58,6 +59,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false, foreach ($colErrors as $error) { $out->startElement('testcase'); $out->writeAttribute('name', $error['source'].' at '.$report['filename']." ($line:$column)"); + $out->writeAttribute('file', $report['filename']); $error['type'] = strtolower($error['type']); if ($phpcsFile->config->encoding !== 'utf-8') { @@ -72,7 +74,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false, $out->endElement(); } } - } + }//end foreach }//end if $out->endElement();