Class CoverageReporter

Description

The base class for reporting coverage. This is an abstract as it does not implement the generateReport() function. Every concrete subclass must implement this method to generate a report.

Located in /reporter/CoverageReporter.php (line 35)


	
			
Direct descendents
Class Description
HtmlCoverageReporter Class that implements HTML Coverage Reporter.
Variable Summary
Method Summary
CoverageReporter __construct ([$heading $heading = "Coverage Report"], [$style $style = ""], [$dir $dir = "report"])
void createReportDir ()
void generateReport (&$data &$data)
void getHeading ()
void getOutputDir ()
String getRelativeOutputDirPath ($filepath $filepath)
void getStyle ()
Relative makeRelative ($filepath $filepath)
void printTextSummary ([$filename=false $filename = false])
void recordFileCoverageInfo (&$fileCoverage &$fileCoverage)
void setCoverageRecorder (mixed &$recorder)
void setHeading (mixed $heading)
void setOutputDir (mixed $dir)
void setStyle (mixed $style)
void updateGrandTotals (&$coverageCounts &$coverageCounts)
Variables
mixed $fileCoverage = array() (line 55)
  • access: protected
mixed $grandTotalCoveredLines (line 50)
  • access: protected
mixed $grandTotalFiles (line 54)
  • access: protected
mixed $grandTotalLines (line 48)
  • access: protected
mixed $grandTotalUncoveredLines (line 52)
  • access: protected
mixed $heading (line 41)
  • access: protected
mixed $outputDir (line 45)
  • access: protected
mixed $recorder = false (line 56)
  • access: protected
mixed $style (line 43)
  • access: protected
Methods
Constructor __construct (line 69)

The constructor (PHP5 compatible)

  • access: public
CoverageReporter __construct ([$heading $heading = "Coverage Report"], [$style $style = ""], [$dir $dir = "report"])
  • $heading $heading
  • $style $style
  • $dir $dir

Redefined in descendants as:
createReportDir (line 91)

Create the report directory if it does not exists

  • access: protected
void createReportDir ()
generateReport (line 257)

This function generates report using one of the concrete subclasses.

  • abstract:
  • access: public
void generateReport (&$data &$data)
  • &$data &$data: Coverage Data recorded by coverage recorder.

Redefined in descendants as:
getFileCoverageInfo (line 149)

Return the array containing file coverage information.

The array returned contains following fields * filename: Name of the file * total: Total number of lines in that file * covered: Total number of executed lines in that file * uncovered: Total number of executable lines that were not executed.

  • return: Array of file coverage information
  • access: public
array getFileCoverageInfo ()
getGrandCodeCoveragePercentage (line 127)

Returns Overall Code Coverage percentage

  • return: Code Coverage percentage rounded to two decimals
  • access: public
double getGrandCodeCoveragePercentage ()
getHeading (line 266)
  • access: public
void getHeading ()
getOutputDir (line 282)
  • access: public
void getOutputDir ()
getRelativeOutputDirPath (line 237)

Get the relative path of report directory with respect to the given filepath

  • return: Relative path of report directory w.r.t. filepath
  • access: protected
String getRelativeOutputDirPath ($filepath $filepath)
  • $filepath $filepath: Path of the file (relative to the report dir)
getStyle (line 274)
  • access: public
void getStyle ()
makeRelative (line 214)

Convert the absolute path to PHP file markup to a path relative to the report dir.

  • return: file path
  • access: protected
Relative makeRelative ($filepath $filepath)
  • $filepath $filepath: PHP markup file path
printTextSummary (line 175)

Print the coverage summary to filename (if specified) or stderr

  • access: public
void printTextSummary ([$filename=false $filename = false])
  • $filename=false $filename: Filename to write the log to
recordFileCoverageInfo (line 162)

Record the file coverage information for a file.

  • access: protected
void recordFileCoverageInfo (&$fileCoverage &$fileCoverage)
  • &$fileCoverage &$fileCoverage: Coverage information for a file
setCoverageRecorder (line 286)
  • access: public
void setCoverageRecorder (mixed &$recorder)
setHeading (line 262)
  • access: public
void setHeading (mixed $heading)
setOutputDir (line 278)
  • access: public
void setOutputDir (mixed $dir)
setStyle (line 270)
  • access: public
void setStyle (mixed $style)
updateGrandTotals (line 110)

Update the grand totals

  • access: protected
void updateGrandTotals (&$coverageCounts &$coverageCounts)
  • &$coverageCounts &$coverageCounts: Coverage counts for a file

Documentation generated on Mon, 20 Jun 2005 13:11:04 -0700 by phpDocumentor 1.3.0RC3