-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I'm running a test on the following basic class:
<?php
namespace ow2\demo;
class Calculator
{
public $var = 'a default value';
public function add(int $a, int $b)
{
return $a + $b;
}
public function sub(int $a, int $b)
{
return $a - $b;
}
}
The test only calls add function so I expect the report to be something like:
<?xml version="1.0" encoding="UTF-8"?>
<coverage version="1">
<file path="src/ow2/demo/Calculator.php">
<lineToCover lineNumber="10" covered="true"/> <!-- return $a + $b; -->
<lineToCover lineNumber="15" covered="false"/> <!-- return $a - $b; -->
</file>
</coverage>
but instead the report include lineToCover entries for function closing braces:
<?xml version="1.0" encoding="UTF-8"?>
<coverage version="1">
<file path="src/ow2/demo/Calculator.php">
<lineToCover lineNumber="10" covered="true"/>
<lineToCover lineNumber="11" covered="false"/>
<lineToCover lineNumber="15" covered="false"/>
<lineToCover lineNumber="16" covered="false"/>
</file>
</coverage>
This report lead to a coverage of 25% in Sonar whereas it should be 50%.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels