Generates code coverage reports in HTML from data obtained from PHPUnit
_guessSubjectName( ReflectionClass $testReflection )
Guess the class name the test was for based on the test case filename.
$testReflection
string
_paintLine( string $line , integer $linenumber , string $class , array $coveringTests )
Renders the HTML for a single line in the HTML diff.
$line
$linenumber
$class
$coveringTests
string
coverageHeader( string $filename , string $percent )
Generate an HTML snippet for coverage headers
$filename
$percent
string
coverageScript( )
generate some javascript for the coverage report.
string
generateDiff( string $filename , array $fileLines , array $coverageData )
Generates an HTML diff for $file based on $coverageData.
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.
$filename
$fileLines
$coverageData
string
__construct( array $coverage , CakeBaseReporter $reporter )
Constructor
$coverage
CakeBaseReporter
$reporter
_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.
$fileLines
$coverageData
array
_setParams( CakeBaseReporter $reporter )
Pulls params out of the reporter.
CakeBaseReporter
$reporter
filterCoverageDataByPath( string $path )
Filters the coverage data by path. Files not in the provided path will be removed.
$path
array
getPathFilter( )
Gets the base path that the files we are interested in live in.
string
setCoverage( array $coverage )
Set the coverage data array
$coverage
protected array
Array of test case file names. Used to do basename() matching with files that have coverage to decide which results to show on page load.
array()
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/class-HtmlCoverageReport.html