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 34)


	
			
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 setHeading (mixed $heading)
void setOutputDir (mixed $dir)
void setStyle (mixed $style)
void updateGrandTotals (&$coverageCounts &$coverageCounts)
Variables
mixed $fileCoverage = array() (line 53)
  • access: protected
mixed $grandTotalCoveredLines (line 49)
  • access: protected
mixed $grandTotalLines (line 47)
  • access: protected
mixed $grandTotalUncoveredLines (line 51)
  • access: protected
mixed $heading (line 40)
  • access: protected
mixed $outputDir (line 44)
  • access: protected
mixed $style (line 42)
  • access: protected
Methods
Constructor __construct (line 66)

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 84)

Create the report directory if it does not exists

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

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 142)

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 120)

Returns Overall Code Coverage percentage

  • return: Code Coverage percentage rounded to two decimals
  • access: public
double getGrandCodeCoveragePercentage ()
getHeading (line 258)
  • access: public
void getHeading ()
getOutputDir (line 274)
  • access: public
void getOutputDir ()
getRelativeOutputDirPath (line 229)

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 266)
  • access: public
void getStyle ()
makeRelative (line 206)

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 168)

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 155)

Record the file coverage information for a file.

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

Update the grand totals

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

Documentation generated on Mon, 16 May 2005 10:01:26 -0700 by phpDocumentor 1.3.0RC3