Skip to content

Commit

Permalink
Fix logic and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishalbert committed Nov 29, 2016
1 parent 799376f commit c629839
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Input/CloverInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private function seekFileStats(array $files)
private function seekLineStats(\SimpleXMLElement $file)
{
foreach ($file->children()->line as $line) {
if (!$line['count']) {
if ((int)$line['count']) {
continue;
}
$lineNumber = (int) $line['num']->__toString();
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/clover-input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<project timestamp="1479006233">
<package name="package">
<file name="/home/user/package/subpackage/Foo.php">
<line num="1" type="stmt" count="1"/>
<line num="1" type="stmt" count="0"/>
<line num="2" type="stmt" count="0"/>
<line num="3" type="stmt" count="0"/>
</file>
<file name="/home/user/package/subpackage/Bar.php">
<line num="4" type="stmt" count="0"/>
<line num="5" type="stmt" count="0"/>
<line num="6" type="stmt" count="0"/>
<line num="6" type="stmt" count="1"/>
</file>
</package>
</project>
Expand Down
5 changes: 1 addition & 4 deletions tests/src/Input/CloverInputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ protected function getExpectedEntries()
],
[
'file' => '/home/user/package/subpackage/Bar.php', 'line' => 5
],
[
'file' => '/home/user/package/subpackage/Bar.php', 'line' => 6
],
]
];
}
}

0 comments on commit c629839

Please sign in to comment.