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

Public Member Functions

 __construct ($includePaths=array("."), $excludePaths=array(), $reporter="new HtmlCoverageReporter()")
 startInstrumentation ()
 stopInstrumentation ()
 generateReport ()
 getErrors ()
 logErrors ()
 getIncludePaths ()
 setIncludePaths ($includePaths)
 getExcludePaths ()
 setExcludePaths ($excludePaths)
 getReporter ()
 setReporter (&$reporter)
 getPhpExtensions ()
 setPhpExtensions (&$extensions)
 getVersion ()
 excludeCoverageDir ()

Protected Member Functions

 removeAbsentPaths (&$dirs)
 processSourcePaths ()
 getFilesAndDirs ($dir, &$files)
 addFiles ()
 stripCoverageData ()
 unixifyCoverageData ()

Protected Attributes

 $includePaths
 $excludePaths
 $reporter
 $coverageData
 $isRemote = false
 $stripped = false
 $phpCoverageFiles = array("phpcoverage.inc.php")
 $version
 $logger
 $phpExtensions

Detailed 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.

Author:
Nimish Pachapurkar <npac@spikesource.com>
Version:
Revision:
1.2

Definition at line 37 of file CoverageRecorder.php.


Constructor & Destructor Documentation

__construct ( includePaths = array("."),
excludePaths = array(),
reporter = "new HtmlCoverageReporter()" 
)

Constructor (PHP5 only)

Parameters:
$includePathsDirectories to be included in code coverage report
$excludePathsDirectories to be excluded from code coverage report
$reporterInstance of a Reporter subclass public

Reimplemented in RemoteCoverageRecorder.

Definition at line 69 of file CoverageRecorder.php.

Here is the call graph for this function:


Member Function Documentation

addFiles ( ) [protected]

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

protected

Definition at line 247 of file CoverageRecorder.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Exclude the directory containing the coverage measurement code.

public

Definition at line 447 of file CoverageRecorder.php.

Here is the caller graph for this function:

Generate the code coverage report

public

Definition at line 138 of file CoverageRecorder.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getErrors ( )

Returns the errors array containing all error encountered so far.

Returns:
Array of error messages public

Definition at line 382 of file CoverageRecorder.php.

Definition at line 410 of file CoverageRecorder.php.

getFilesAndDirs ( dir,
&$  files 
) [protected]

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

Parameters:
$dirRoot directory
&$filesArray of filenames to append to protected

Definition at line 209 of file CoverageRecorder.php.

Here is the caller graph for this function:

Definition at line 402 of file CoverageRecorder.php.

Definition at line 427 of file CoverageRecorder.php.

Definition at line 419 of file CoverageRecorder.php.

Definition at line 435 of file CoverageRecorder.php.

logErrors ( )

Writes all error messages to error log

public

Definition at line 394 of file CoverageRecorder.php.

processSourcePaths ( ) [protected]

Processes and validates the source directories

protected

Definition at line 192 of file CoverageRecorder.php.

Here is the call graph for this function:

Here is the caller graph for this function:

removeAbsentPaths ( &$  dirs) [protected]

Remove the directories that do not exist from the input array

Parameters:
&$dirsArray of directory names protected

Definition at line 169 of file CoverageRecorder.php.

Here is the caller graph for this function:

setExcludePaths ( excludePaths)

Definition at line 414 of file CoverageRecorder.php.

Here is the call graph for this function:

setIncludePaths ( includePaths)

Definition at line 406 of file CoverageRecorder.php.

setPhpExtensions ( &$  extensions)

Definition at line 431 of file CoverageRecorder.php.

setReporter ( &$  reporter)

Definition at line 423 of file CoverageRecorder.php.

Starts the code coverage recording

public

Definition at line 98 of file CoverageRecorder.php.

Here is the caller graph for this function:

Stops code coverage recording

public

Definition at line 116 of file CoverageRecorder.php.

Here is the caller graph for this function:

stripCoverageData ( ) [protected]

Removes the unwanted coverage data from the recordings

Returns:
Processed coverage data protected

Definition at line 289 of file CoverageRecorder.php.

Here is the call graph for this function:

Here is the caller graph for this function:

unixifyCoverageData ( ) [protected]

Convert filepaths in coverage data to forward slash separated paths.

protected

Definition at line 364 of file CoverageRecorder.php.

Here is the caller graph for this function:


Field Documentation

$coverageData [protected]

Definition at line 44 of file CoverageRecorder.php.

$excludePaths [protected]

Definition at line 42 of file CoverageRecorder.php.

$includePaths [protected]

Definition at line 41 of file CoverageRecorder.php.

$isRemote = false [protected]

Definition at line 45 of file CoverageRecorder.php.

$logger [protected]

Definition at line 49 of file CoverageRecorder.php.

$phpCoverageFiles = array("phpcoverage.inc.php") [protected]

Definition at line 47 of file CoverageRecorder.php.

$phpExtensions [protected]

What extensions are treated as php files.

Parameters:
phpArray of extension strings

Definition at line 56 of file CoverageRecorder.php.

$reporter [protected]

Definition at line 43 of file CoverageRecorder.php.

$stripped = false [protected]

Definition at line 46 of file CoverageRecorder.php.

$version [protected]

Definition at line 48 of file CoverageRecorder.php.


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