Class TextCoverageReport
Generates code coverage reports in Simple plain text from data obtained from PHPUnit
- BaseCoverageReport
- TextCoverageReport
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/TestSuite/Coverage/TextCoverageReport.php
Inherited Properties
Method Summary
-
generateDiff() public
Generates a 'diff' report for a file. Since diffs are too big for plain text reports a simple file => % covered is done.
-
report() public
Generates report text to display.
Method Detail
generateDiff() public ¶
generateDiff( string $filename , array $fileLines , array $coverageData )
Generates a 'diff' report for a file. Since diffs are too big for plain text reports a simple file => % covered is done.
Parameters
- string $filename
- Name of the file having coverage generated
- array $fileLines
- File data as an array. See file() for how to get one of these.
- array $coverageData
- Array of coverage data to use to generate HTML diffs with
Returns
Methods inherited from BaseCoverageReport
__construct() public ¶
__construct( array $coverage , CakeBaseReporter
$reporter )
Constructor
Parameters
- array $coverage
- Array of coverage data from PHPUnit_Test_Result
-
CakeBaseReporter
$reporter - A reporter to use for the coverage report.
_calculateCoveredLines() protected ¶
_calculateCoveredLines( array $fileLines , array $coverageData )
Calculates how many lines are covered and what the total number of executable lines is.
Handles both PHPUnit3.5 and 3.6 formats.
3.5 uses -1 for uncovered, and -2 for dead. 3.6 uses array() for uncovered and null for dead.
Parameters
- array $fileLines
- array $coverageData
Returns
Array of covered, total lines.
_setParams() protected ¶
_setParams( CakeBaseReporter
$reporter )
Pulls params out of the reporter.
Parameters
-
CakeBaseReporter
$reporter - Reporter to suck params out of.
filterCoverageDataByPath() public ¶
filterCoverageDataByPath( string $path )
Filters the coverage data by path. Files not in the provided path will be removed.
Parameters
- string $path
- Path to filter files by.
Returns
Array of coverage data for files that match the given path.
getPathFilter() public ¶
getPathFilter( )
Gets the base path that the files we are interested in live in.
setCoverage() public ¶
setCoverage( array $coverage )
Set the coverage data array
Parameters
- array $coverage
- Coverage data to use.