Skip to content

Commit

Permalink
make coverage 'show_only_summary' configurable (#5142)
Browse files Browse the repository at this point in the history
* make 'show_only_summary' on init `\SebastianBergmann\CodeCoverage\Report\Text` configurable

* updates codecoverage docs for new config option

* updates codecoverage docs, phpunit configuration reference link
  • Loading branch information
Quexer69 authored and DavertMik committed Sep 11, 2018
1 parent f957aa0 commit 7af6317
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
18 changes: 18 additions & 0 deletions docs/11-Codecoverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ coverage:
high_limit: 60
```

By default, show all whitelisted files in `--coverage-text` output not just the ones with coverage information is set to false, config option:

```yaml
coverage:
enabled: true
show_uncovered: false
```

By default, show only the coverage report summary in `--coverage-text` output is set to false, config option:

```yaml
coverage:
enabled: true
show_only_summary: false
```

For further information please refer to the [PHPUnit configuration docs](https://phpunit.readthedocs.io/en/latest/configuration.html)

## Local CodeCoverage

The basic codecoverage can be collected for functional and unit tests.
Expand Down
13 changes: 7 additions & 6 deletions src/Codeception/Coverage/Subscriber/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class Printer implements EventSubscriberInterface
];

protected $settings = [
'enabled' => true,
'low_limit' => '35',
'high_limit' => '70',
'show_uncovered' => false
'enabled' => true,
'low_limit' => '35',
'high_limit' => '70',
'show_uncovered' => false,
'show_only_summary' => false
];

public static $coverage;
Expand Down Expand Up @@ -92,7 +93,7 @@ protected function printConsole(\PHPUnit\Util\Printer $printer)
$this->settings['low_limit'],
$this->settings['high_limit'],
$this->settings['show_uncovered'],
false
$this->settings['show_only_summary']
);
$printer->write($writer->process(self::$coverage, $this->options['colors']));
}
Expand Down Expand Up @@ -129,7 +130,7 @@ protected function printText()
$this->settings['low_limit'],
$this->settings['high_limit'],
$this->settings['show_uncovered'],
false
$this->settings['show_only_summary']
);
file_put_contents(
$this->absolutePath($this->options['coverage-text']),
Expand Down

0 comments on commit 7af6317

Please sign in to comment.