Skip to content

Commit c629839

Browse files
committed
Fix logic and tests.
1 parent 799376f commit c629839

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/Input/CloverInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private function seekFileStats(array $files)
3939
private function seekLineStats(\SimpleXMLElement $file)
4040
{
4141
foreach ($file->children()->line as $line) {
42-
if (!$line['count']) {
42+
if ((int)$line['count']) {
4343
continue;
4444
}
4545
$lineNumber = (int) $line['num']->__toString();

tests/resources/clover-input.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<project timestamp="1479006233">
44
<package name="package">
55
<file name="/home/user/package/subpackage/Foo.php">
6-
<line num="1" type="stmt" count="1"/>
6+
<line num="1" type="stmt" count="0"/>
77
<line num="2" type="stmt" count="0"/>
88
<line num="3" type="stmt" count="0"/>
99
</file>
1010
<file name="/home/user/package/subpackage/Bar.php">
1111
<line num="4" type="stmt" count="0"/>
1212
<line num="5" type="stmt" count="0"/>
13-
<line num="6" type="stmt" count="0"/>
13+
<line num="6" type="stmt" count="1"/>
1414
</file>
1515
</package>
1616
</project>

tests/src/Input/CloverInputTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ protected function getExpectedEntries()
5050
],
5151
[
5252
'file' => '/home/user/package/subpackage/Bar.php', 'line' => 5
53-
],
54-
[
55-
'file' => '/home/user/package/subpackage/Bar.php', 'line' => 6
56-
],
53+
]
5754
];
5855
}
5956
}

0 commit comments

Comments
 (0)