Moodle  2.2.1
http://www.collinsharper.com
CoverageReporter Class Reference
Inheritance diagram for CoverageReporter:

Public Member Functions

 __construct ($heading="Coverage Report", $style="", $dir="report")
 getGrandCodeCoveragePercentage ()
 getFileCoverageInfo ()
 printTextSummary ($filename=false)
 generateReport (&$data)
 setHeading ($heading)
 getHeading ()
 setStyle ($style)
 getStyle ()
 setOutputDir ($dir)
 getOutputDir ()
 setCoverageRecorder (&$recorder)

Protected Member Functions

 createReportDir ()
 updateGrandTotals (&$coverageCounts)
 recordFileCoverageInfo (&$fileCoverage)
 makeRelative ($filepath)
 getRelativeOutputDirPath ($filepath)

Protected Attributes

 $logger
 $heading
 $style
 $outputDir
 $grandTotalLines
 $grandTotalCoveredLines
 $grandTotalUncoveredLines
 $grandTotalFiles
 $fileCoverage = array()
 $recorder = false

Detailed Description

Definition at line 37 of file CoverageReporter.php.


Constructor & Destructor Documentation

__construct ( heading = "Coverage Report",
style = "",
dir = "report" 
)

The constructor (PHP5 compatible)

Parameters:
$heading
$style
$dirpublic

Reimplemented in HtmlCoverageReporter.

Definition at line 71 of file CoverageReporter.php.

Here is the call graph for this function:


Member Function Documentation

createReportDir ( ) [protected]

Create the report directory if it does not exists

protected

Definition at line 100 of file CoverageReporter.php.

Here is the caller graph for this function:

generateReport ( &$  data) [abstract]

This function generates report using one of the concrete subclasses.

Parameters:
&$dataCoverage Data recorded by coverage recorder. public

Reimplemented in moodle_coverage_reporter, and HtmlCoverageReporter.

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.

Returns:
array Array of file coverage information public

Definition at line 158 of file CoverageReporter.php.

Returns Overall Code Coverage percentage

Returns:
double Code Coverage percentage rounded to two decimals public

Definition at line 136 of file CoverageReporter.php.

Here is the caller graph for this function:

Definition at line 276 of file CoverageReporter.php.

Definition at line 292 of file CoverageReporter.php.

getRelativeOutputDirPath ( filepath) [protected]

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

Parameters:
$filepathPath of the file (relative to the report dir)
Returns:
String Relative path of report directory w.r.t. filepath protected

Definition at line 247 of file CoverageReporter.php.

getStyle ( )

Definition at line 284 of file CoverageReporter.php.

makeRelative ( filepath) [protected]

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

Parameters:
$filepathPHP markup file path
Returns:
Relative file path protected

Definition at line 224 of file CoverageReporter.php.

Here is the caller graph for this function:

printTextSummary ( filename = false)

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

Parameters:
$filename=falseFilename to write the log to public

Definition at line 184 of file CoverageReporter.php.

Here is the call graph for this function:

recordFileCoverageInfo ( &$  fileCoverage) [protected]

Record the file coverage information for a file.

Parameters:
&$fileCoverageCoverage information for a file protected

Definition at line 171 of file CoverageReporter.php.

Here is the caller graph for this function:

setCoverageRecorder ( &$  recorder)

Definition at line 296 of file CoverageReporter.php.

setHeading ( heading)

Definition at line 272 of file CoverageReporter.php.

setOutputDir ( dir)

Definition at line 288 of file CoverageReporter.php.

setStyle ( style)

Definition at line 280 of file CoverageReporter.php.

updateGrandTotals ( &$  coverageCounts) [protected]

Update the grand totals

Parameters:
&$coverageCountsCoverage counts for a file protected

Reimplemented in moodle_coverage_reporter.

Definition at line 119 of file CoverageReporter.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$fileCoverage = array() [protected]

Definition at line 57 of file CoverageReporter.php.

$grandTotalCoveredLines [protected]

Definition at line 52 of file CoverageReporter.php.

$grandTotalFiles [protected]

Definition at line 56 of file CoverageReporter.php.

$grandTotalLines [protected]

Definition at line 50 of file CoverageReporter.php.

$grandTotalUncoveredLines [protected]

Definition at line 54 of file CoverageReporter.php.

$heading [protected]

Definition at line 43 of file CoverageReporter.php.

$logger [protected]

Definition at line 40 of file CoverageReporter.php.

$outputDir [protected]

Definition at line 47 of file CoverageReporter.php.

$recorder = false [protected]

Definition at line 58 of file CoverageReporter.php.

$style [protected]

Definition at line 45 of file CoverageReporter.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations