Skip to content

Commit

Permalink
Fix Cobertura tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug authored and sebastianbergmann committed Oct 9, 2020
1 parent 53a4b73 commit ece0c3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Report/Cobertura.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string
$classElement = $document->createElement('class');

$classElement->setAttribute('name', $className);
$classElement->setAttribute('filename', str_replace($report->pathAsString() . '/', '', $item->pathAsString()));
$classElement->setAttribute('filename', str_replace($report->pathAsString() . DIRECTORY_SEPARATOR, '', $item->pathAsString()));
$classElement->setAttribute('line-rate', (string) $lineRate);
$classElement->setAttribute('branch-rate', (string) $branchRate);
$classElement->setAttribute('complexity', (string) $class['ccn']);
Expand Down Expand Up @@ -206,7 +206,7 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string

$classElement = $document->createElement('class');
$classElement->setAttribute('name', basename($item->pathAsString()));
$classElement->setAttribute('filename', str_replace($report->pathAsString() . '/', '', $item->pathAsString()));
$classElement->setAttribute('filename', str_replace($report->pathAsString() . DIRECTORY_SEPARATOR, '', $item->pathAsString()));

$methodsElement = $document->createElement('methods');

Expand Down

0 comments on commit ece0c3c

Please sign in to comment.