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


	
			
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 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 42)
  • access: protected
mixed $excludePaths (line 40)
  • access: protected
mixed $includePaths (line 39)
  • access: protected
mixed $isRemote = false (line 43)
  • access: protected
mixed $phpCoverageFiles = array("phpcoverage.inc.php") (line 45)
  • access: protected
mixed $phpExtensions = array("php", "tpl") (line 52)

What extensions are treated as php files.

  • access: protected
mixed $reporter (line 41)
  • access: protected
mixed $stripped = false (line 44)
  • access: protected
Methods
Constructor __construct (line 65)

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

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

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

Exclude the directory containing the coverage measurement code.

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

Generate the code coverage report

  • access: public
void generateReport ()

Redefined in descendants as:
getErrors (line 331)

Returns the errors array containing all error encountered so far.

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

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 350)
  • access: public
void getIncludePaths ()
getPhpExtensions (line 375)
  • access: public
void getPhpExtensions ()
getReporter (line 367)
  • access: public
void getReporter ()
logErrors (line 343)

Writes all error messages to error log

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

Processes and validates the source directories

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

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 362)
  • access: public
void setExcludePaths (mixed $excludePaths)
setIncludePaths (line 354)
  • access: public
void setIncludePaths (mixed $includePaths)
setPhpExtensions (line 379)
  • access: public
void setPhpExtensions (mixed &$extensions)
setReporter (line 371)
  • access: public
void setReporter (mixed &$reporter)
startInstrumentation (line 80)

Starts the code coverage recording

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

Stops code coverage recording

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

Removes the unwanted coverage data from the recordings

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

Convert filepaths in coverage data to forward slash separated paths.

  • access: protected
void unixifyCoverageData ()

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