PHP Класс lithium\test\filter\Coverage

Наследование: extends lithium\test\Filter
Показать файл Открыть проект

Открытые методы

Метод Описание
analyze ( object $report, array $classes = [] ) : array Analyzes code coverage results collected from XDebug, and performs coverage density analysis.
apply ( object $report, array $tests, array $options = [] ) : object Takes an instance of an object (usually a Collection object) containing test instances. Attaches code coverage filtering to test cases.
collect ( array $filterResults, array $options = [] ) : array Collects code coverage analysis results from xdebug_get_code_coverage().
collectLines ( array $result ) : array Takes the raw line numbers and returns results with the code from uncovered lines included.

Защищенные методы

Метод Описание
_density ( array $runs, array $classMap = [] ) : array Reduces the results of multiple XDebug code coverage runs into a single 2D array of the aggregate line coverage density per file.

Описание методов

_density() защищенный статический Метод

Reduces the results of multiple XDebug code coverage runs into a single 2D array of the aggregate line coverage density per file.
protected static _density ( array $runs, array $classMap = [] ) : array
$runs array An array containing multiple runs of raw XDebug coverage data, where each array key is a file name, and its value is XDebug's coverage data for that file.
$classMap array An optional map with class names as array keys and corresponding file names as values. Used to filter the returned results, and will cause the array keys of the results to be class names instead of file names.
Результат array

analyze() публичный статический Метод

Analyzes code coverage results collected from XDebug, and performs coverage density analysis.
public static analyze ( object $report, array $classes = [] ) : array
$report object The report instance running this filter and aggregating results
$classes array A list of classes to analyze coverage on. By default, gets all defined subclasses of lithium\test\Unit which are currently in memory.
Результат array Returns an array indexed by file and line, showing the number of instances each line was called.

apply() публичный статический Метод

Takes an instance of an object (usually a Collection object) containing test instances. Attaches code coverage filtering to test cases.
См. также: lithium\test\filter\Coverage::collect()
public static apply ( object $report, array $tests, array $options = [] ) : object
$report object Instance of Report which is calling apply.
$tests array The test to apply this filter on
$options array Options for how code coverage should be applied. These options are also passed to `Coverage::collect()` to determine how to aggregate results. See the documentation for `collect()` for further options. Options affecting this method are: -'method': The name of method to attach to, defaults to 'run'.
Результат object Returns the instance of `$tests` with code coverage analysis triggers applied.

collect() публичный статический Метод

Collects code coverage analysis results from xdebug_get_code_coverage().
См. также: lithium\test\filter\Coverage::analyze()
public static collect ( array $filterResults, array $options = [] ) : array
$filterResults array An array of results arrays from `xdebug_get_code_coverage()`.
$options array Set of options defining how results should be collected.
Результат array The packaged filter results.

collectLines() публичный статический Метод

Takes the raw line numbers and returns results with the code from uncovered lines included.
public static collectLines ( array $result ) : array
$result array The raw line number results
Результат array