Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
handle coverage-text argument "showOnlySummary"
  • Loading branch information
jakoch committed Nov 8, 2012
commit 21c7a1fbd4e23877adeb3479c75c6044d8d2d0b7
11 changes: 8 additions & 3 deletions PHP/CodeCoverage/Report/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class PHP_CodeCoverage_Report_Text
protected $lowUpperBound;
protected $highLowerBound;
protected $showUncoveredFiles;
protected $showOnlySummary;

protected $colors = array(
'green' => "\x1b[30;42m",
Expand All @@ -72,18 +73,18 @@ class PHP_CodeCoverage_Report_Text
'eol' => "\x1b[2K",
);

public function __construct(PHPUnit_Util_Printer $outputStream, $lowUpperBound, $highLowerBound, $showUncoveredFiles)
public function __construct(PHPUnit_Util_Printer $outputStream, $lowUpperBound, $highLowerBound, $showUncoveredFiles, $showOnlySummary)
{
$this->outputStream = $outputStream;
$this->lowUpperBound = $lowUpperBound;
$this->highLowerBound = $highLowerBound;
$this->showUncoveredFiles = $showUncoveredFiles;
$this->showOnlySummary = $showOnlySummary;
}

/**
* @param PHP_CodeCoverage $coverage
* @param string $target
* @param string $name
* @param bool $showColors
* @return string
*/
public function process(PHP_CodeCoverage $coverage, $showColors = FALSE)
Expand Down Expand Up @@ -134,6 +135,10 @@ public function process(PHP_CodeCoverage $coverage, $showColors = FALSE)
. $colors['lines'] . $colors['eol'] . ' Lines: ' . PHP_CodeCoverage_Util::percent($report->getNumExecutedLines(), $report->getNumExecutableLines(), TRUE)
. ' (' . $report->getNumExecutedLines() . '/' . $report->getNumExecutableLines() . ')' . PHP_EOL . $colors['reset'] . $colors ['eol'];

if ($this->showOnlySummary) {
return $this->outputStream->write($output . PHP_EOL);
}

$classCoverage = array();

foreach ($report as $item) {
Expand Down