Class CoverageRecorder

Description

The Coverage Recorder utility

This is the main class for the CoverageRecorder. User should instantiate this class and set various parameters of it. The startInstrumentation and stopInstrumentation methods will switch code coverage recording on and off respectively.

The code coverage is recorded using XDebug Zend Extension. Therefore, it is required to install that extension on the system where code coverage measurement is going to take place. See www.xdebug.org for more information.

Located in /CoverageRecorder.php (line 37)


	
			
Direct descendents
Class Description
RemoteCoverageRecorder A Coverage recorder extension for remote Coverage measurement.
Variable Summary
Method Summary
CoverageRecorder __construct ([$includePaths $includePaths = array(".")], [$excludePaths $excludePaths = array()], [$reporter $reporter = "new HtmlCoverageReporter()"])
void addFiles ()
void generateReport ()
Array getErrors ()
void getExcludePaths ()
void getFilesAndDirs ($dir $dir, &$files &$files)
void getIncludePaths ()
void getReporter ()
void getVersion ()
void logErrors ()
void removeAbsentPaths (&$dirs &$dirs)
void setExcludePaths (mixed $excludePaths)
void setIncludePaths (mixed $includePaths)
void setPhpExtensions (mixed &$extensions)
void setReporter (mixed &$reporter)
Processed stripCoverageData ()
Variables
mixed $coverageData (line 44)
  • access: protected
mixed $excludePaths (line 42)
  • access: protected
mixed $includePaths (line 41)
  • access: protected
mixed $isRemote = false (line 45)
  • access: protected
mixed $logger (line 49)
  • access: protected
mixed $phpCoverageFiles = array("phpcoverage.inc.php") (line 47)
  • access: protected
mixed $phpExtensions (line 56)

What extensions are treated as php files.

  • access: protected
mixed $reporter (line 43)
  • access: protected
mixed $stripped = false (line 46)
  • access: protected
mixed $version (line 48)
  • access: protected
Methods
Constructor __construct (line 69)

Constructor (PHP5 only)

  • access: public
CoverageRecorder __construct ([$includePaths $includePaths = array(".")], [$excludePaths $excludePaths = array()], [$reporter $reporter = "new HtmlCoverageReporter()"])
  • $includePaths $includePaths: Directories to be included in code coverage report
  • $excludePaths $excludePaths: Directories to be excluded from code coverage report
  • $reporter $reporter: Instance of a Reporter subclass

Redefined in descendants as:
addFiles (line 247)

Add all source files to the list of files that need to be parsed.

  • access: protected
void addFiles ()
excludeCoverageDir (line 434)

Exclude the directory containing the coverage measurement code.

  • access: public
void excludeCoverageDir ()
generateReport (line 138)

Generate the code coverage report

  • access: public
void generateReport ()

Redefined in descendants as:
  • RemoteCoverageRecorder::generateReport() : Generate report from the xml coverage data The preferred method for usage of this function is passing a stream of the XML data in. This is much more efficient and consumes less memory.
getErrors (line 369)

Returns the errors array containing all error encountered so far.

  • return: of error messages
  • access: public
Array getErrors ()
getExcludePaths (line 397)
  • access: public
void getExcludePaths ()
getFilesAndDirs (line 209)

Get the list of files that match the extensions in $this->phpExtensions

  • access: protected
void getFilesAndDirs ($dir $dir, &$files &$files)
  • $dir $dir: Root directory
  • &$files &$files: Array of filenames to append to
getIncludePaths (line 389)
  • access: public
void getIncludePaths ()
getPhpExtensions (line 414)
  • access: public
void getPhpExtensions ()
getReporter (line 406)
  • access: public
void getReporter ()
getVersion (line 422)
  • access: public
void getVersion ()
logErrors (line 381)

Writes all error messages to error log

  • access: public
void logErrors ()
processSourcePaths (line 192)

Processes and validates the source directories

  • access: protected
void processSourcePaths ()
removeAbsentPaths (line 169)

Remove the directories that do not exist from the input array

  • access: protected
void removeAbsentPaths (&$dirs &$dirs)
  • &$dirs &$dirs: Array of directory names
setExcludePaths (line 401)
  • access: public
void setExcludePaths (mixed $excludePaths)
setIncludePaths (line 393)
  • access: public
void setIncludePaths (mixed $includePaths)
setPhpExtensions (line 418)
  • access: public
void setPhpExtensions (mixed &$extensions)
setReporter (line 410)
  • access: public
void setReporter (mixed &$reporter)
startInstrumentation (line 98)

Starts the code coverage recording

  • access: public
void startInstrumentation ()
stopInstrumentation (line 116)

Stops code coverage recording

  • access: public
void stopInstrumentation ()
stripCoverageData (line 289)

Removes the unwanted coverage data from the recordings

  • return: coverage data
  • access: protected
Processed stripCoverageData ()
unixifyCoverageData (line 351)

Convert filepaths in coverage data to forward slash separated paths.

  • access: protected
void unixifyCoverageData ()

Documentation generated on Fri, 06 Jul 2007 12:51:35 -0700 by phpDocumentor 1.3.0RC3