Skip to content

Commit

Permalink
collect with parenthesis and update spec for Lcov
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Oct 2, 2016
1 parent 7e0f14d commit 4fc990f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions spec/Suite/Reporter/Coverage/Exporter/Lcov.spec.php
Expand Up @@ -44,9 +44,8 @@
$ds = DS;

$expected = <<<EOD
TN:
SF:/home/kahlan/kahlan/spec/Fixture/Reporter/Coverage/NoEmptyLine.php
1,shallNotPass
TN:\nSF:/home/kahlan/kahlan/spec/Fixture/Reporter/Coverage/NoEmptyLine.php
FN:6,shallNotPass
FNDA:1,shallNotPass
FNF:1
FNH:1
Expand Down Expand Up @@ -88,7 +87,7 @@
$expected = <<<EOD
TN:
SF:/home/kahlan/kahlan/spec/Fixture/Reporter/Coverage/ExtraEmptyLine.php
1,shallNotPass
FN:6,shallNotPass
FNDA:1,shallNotPass
FNF:1
FNH:1
Expand All @@ -100,7 +99,6 @@
LH:2
end_of_record
EOD;

expect($txt)->toBe($expected);

});
Expand Down Expand Up @@ -140,15 +138,15 @@
'base_path' => DS . 'home' . DS . 'kahlan' . DS . 'kahlan'
]);

expect($success)->toBe(175);
expect($success)->toBe(178);

$txt = file_get_contents($this->output);
$ds = DS;

$expected = <<<EOD
TN:
SF:/home/kahlan/kahlan/spec/Fixture/Reporter/Coverage/NoEmptyLine.php
1,shallNotPass
FN:6,shallNotPass
FNDA:1,shallNotPass
FNF:1
FNH:1
Expand Down
2 changes: 1 addition & 1 deletion src/Reporter/Coverage/Exporter/Lcov.php
Expand Up @@ -80,7 +80,7 @@ protected static function _export($path, $tree, $coverage)
foreach ($content['nodes'] as $node) {
if ($node->type === 'function' && $node->lines['start'] === $num) {
if ($node->isMethod || !$node->isClosure) {
$result[] = 'FN:' . $num + 1 . ',' . $node->name;
$result[] = 'FN:' . ($num + 1) . ',' . $node->name;
$fnda[$node->name] = 0;
$fnf++;
$fnCurr = $node;
Expand Down

0 comments on commit 4fc990f

Please sign in to comment.