diff --git a/src/Report/Cobertura.php b/src/Report/Cobertura.php index fa38b64f2..3662a9ecd 100644 --- a/src/Report/Cobertura.php +++ b/src/Report/Cobertura.php @@ -49,13 +49,13 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string $coverageElement = $document->createElement('coverage'); - $linesValid = $report->numberOfExecutedLines(); - $linesCovered = $report->numberOfExecutableLines(); + $linesValid = $report->numberOfExecutableLines(); + $linesCovered = $report->numberOfExecutedLines(); $lineRate = $linesValid === 0 ? 0 : ($linesCovered / $linesValid); $coverageElement->setAttribute('line-rate', (string) $lineRate); - $branchesValid = $report->numberOfExecutedBranches(); - $branchesCovered = $report->numberOfExecutableBranches(); + $branchesValid = $report->numberOfExecutableBranches(); + $branchesCovered = $report->numberOfExecutedBranches(); $branchRate = $branchesValid === 0 ? 0 : ($branchesCovered / $branchesValid); $coverageElement->setAttribute('branch-rate', (string) $branchRate); diff --git a/tests/_files/BankAccount-cobertura-line.xml b/tests/_files/BankAccount-cobertura-line.xml index 0ca5a6e0e..b1fc283b9 100644 --- a/tests/_files/BankAccount-cobertura-line.xml +++ b/tests/_files/BankAccount-cobertura-line.xml @@ -1,6 +1,6 @@ - + %s diff --git a/tests/_files/BankAccount-cobertura-path.xml b/tests/_files/BankAccount-cobertura-path.xml index c221fd1fd..948eb73c6 100644 --- a/tests/_files/BankAccount-cobertura-path.xml +++ b/tests/_files/BankAccount-cobertura-path.xml @@ -1,6 +1,6 @@ - + %s diff --git a/tests/_files/class-with-anonymous-function-cobertura.xml b/tests/_files/class-with-anonymous-function-cobertura.xml index 23b832314..83451bc2e 100644 --- a/tests/_files/class-with-anonymous-function-cobertura.xml +++ b/tests/_files/class-with-anonymous-function-cobertura.xml @@ -1,6 +1,6 @@ - + %s diff --git a/tests/_files/ignored-lines-cobertura.xml b/tests/_files/ignored-lines-cobertura.xml index 87622f207..e0f9c4c38 100644 --- a/tests/_files/ignored-lines-cobertura.xml +++ b/tests/_files/ignored-lines-cobertura.xml @@ -1,6 +1,6 @@ - + %s