Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/Node/AbstractNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,34 @@ public function getTestedMethodsPercent(bool $asString = true)
);
}

/**
* Returns the percentage of paths that have been tested.
*
* @return int|string
*/
public function getTestedPathsPercent(bool $asString = true)
{
return Util::percent(
$this->getNumTestedPaths(),
$this->getNumPaths(),
$asString
);
}

/**
* Returns the percentage of branches that have been tested.
*
* @return int|string
*/
public function getTestedBranchesPercent(bool $asString = true)
{
return Util::percent(
$this->getNumTestedBranches(),
$this->getNumBranches(),
$asString
);
}

/**
* Returns the percentage of functions and methods that has been tested.
*
Expand Down Expand Up @@ -276,6 +304,16 @@ abstract public function getFunctions(): array;
*/
abstract public function getLinesOfCode(): array;

/**
* Returns the paths of this node.
*/
abstract public function getPaths(): array;

/**
* Returns the branches of this node.
*/
abstract public function getBranches(): array;

/**
* Returns the number of executable lines.
*/
Expand Down Expand Up @@ -325,4 +363,24 @@ abstract public function getNumFunctions(): int;
* Returns the number of tested functions.
*/
abstract public function getNumTestedFunctions(): int;

/**
* Returns the number of paths.
*/
abstract public function getNumPaths(): int;

/**
* Returns the number of tested paths.
*/
abstract public function getNumTestedPaths(): int;

/**
* Returns the number of branches.
*/
abstract public function getNumBranches(): int;

/**
* Returns the number of tested branches.
*/
abstract public function getNumTestedBranches(): int;
}