diff --git a/src/Data/ProcessedClassType.php b/src/Data/ProcessedClassType.php index 22d6c99df..716722c62 100644 --- a/src/Data/ProcessedClassType.php +++ b/src/Data/ProcessedClassType.php @@ -26,6 +26,11 @@ final class ProcessedClassType public readonly int $startLine; public int $executableLines; public int $executedLines; + public int $executedLinesBySmallTests = 0; + public int $executedLinesByMediumTests = 0; + public int $executedLinesByLargeTests = 0; + public int $executedLinesBySmallOrMediumTests = 0; + public int $executedLinesBySmallOrMediumOrLargeTests = 0; public int $executableBranches; public int $executedBranches; public int $executablePaths; diff --git a/src/Data/ProcessedFunctionType.php b/src/Data/ProcessedFunctionType.php index c97069b8f..72716880f 100644 --- a/src/Data/ProcessedFunctionType.php +++ b/src/Data/ProcessedFunctionType.php @@ -23,6 +23,11 @@ final class ProcessedFunctionType public readonly int $endLine; public int $executableLines; public int $executedLines; + public int $executedLinesBySmallTests = 0; + public int $executedLinesByMediumTests = 0; + public int $executedLinesByLargeTests = 0; + public int $executedLinesBySmallOrMediumTests = 0; + public int $executedLinesBySmallOrMediumOrLargeTests = 0; public int $executableBranches; public int $executedBranches; public int $executablePaths; diff --git a/src/Data/ProcessedMethodType.php b/src/Data/ProcessedMethodType.php index 861b005d8..cc4b6ce90 100644 --- a/src/Data/ProcessedMethodType.php +++ b/src/Data/ProcessedMethodType.php @@ -23,6 +23,11 @@ final class ProcessedMethodType public readonly int $endLine; public int $executableLines; public int $executedLines; + public int $executedLinesBySmallTests = 0; + public int $executedLinesByMediumTests = 0; + public int $executedLinesByLargeTests = 0; + public int $executedLinesBySmallOrMediumTests = 0; + public int $executedLinesBySmallOrMediumOrLargeTests = 0; public int $executableBranches; public int $executedBranches; public int $executablePaths; diff --git a/src/Data/ProcessedTraitType.php b/src/Data/ProcessedTraitType.php index e71ee5d10..d8aba39af 100644 --- a/src/Data/ProcessedTraitType.php +++ b/src/Data/ProcessedTraitType.php @@ -26,6 +26,11 @@ final class ProcessedTraitType public readonly int $startLine; public int $executableLines; public int $executedLines; + public int $executedLinesBySmallTests = 0; + public int $executedLinesByMediumTests = 0; + public int $executedLinesByLargeTests = 0; + public int $executedLinesBySmallOrMediumTests = 0; + public int $executedLinesBySmallOrMediumOrLargeTests = 0; public int $executableBranches; public int $executedBranches; public int $executablePaths; diff --git a/src/Node/AbstractNode.php b/src/Node/AbstractNode.php index 0dc982cbf..6fa7c8d32 100644 --- a/src/Node/AbstractNode.php +++ b/src/Node/AbstractNode.php @@ -135,6 +135,46 @@ public function percentageOfExecutedLines(): Percentage ); } + public function percentageOfExecutedLinesBySmallTests(): Percentage + { + return Percentage::fromFractionAndTotal( + $this->numberOfExecutedLinesBySmallTests(), + $this->numberOfExecutableLines(), + ); + } + + public function percentageOfExecutedLinesByMediumTests(): Percentage + { + return Percentage::fromFractionAndTotal( + $this->numberOfExecutedLinesByMediumTests(), + $this->numberOfExecutableLines(), + ); + } + + public function percentageOfExecutedLinesByLargeTests(): Percentage + { + return Percentage::fromFractionAndTotal( + $this->numberOfExecutedLinesByLargeTests(), + $this->numberOfExecutableLines(), + ); + } + + public function percentageOfExecutedLinesBySmallOrMediumTests(): Percentage + { + return Percentage::fromFractionAndTotal( + $this->numberOfExecutedLinesBySmallOrMediumTests(), + $this->numberOfExecutableLines(), + ); + } + + public function percentageOfExecutedLinesBySmallOrMediumOrLargeTests(): Percentage + { + return Percentage::fromFractionAndTotal( + $this->numberOfExecutedLinesBySmallOrMediumOrLargeTests(), + $this->numberOfExecutableLines(), + ); + } + public function percentageOfExecutedBranches(): Percentage { return Percentage::fromFractionAndTotal( @@ -161,6 +201,31 @@ public function numberOfTestedClassesAndTraits(): int return $this->numberOfTestedClasses() + $this->numberOfTestedTraits(); } + public function numberOfTestedClassesAndTraitsBySmallTests(): int + { + return $this->numberOfTestedClassesBySmallTests() + $this->numberOfTestedTraitsBySmallTests(); + } + + public function numberOfTestedClassesAndTraitsByMediumTests(): int + { + return $this->numberOfTestedClassesByMediumTests() + $this->numberOfTestedTraitsByMediumTests(); + } + + public function numberOfTestedClassesAndTraitsByLargeTests(): int + { + return $this->numberOfTestedClassesByLargeTests() + $this->numberOfTestedTraitsByLargeTests(); + } + + public function numberOfTestedClassesAndTraitsBySmallOrMediumTests(): int + { + return $this->numberOfTestedClassesBySmallOrMediumTests() + $this->numberOfTestedTraitsBySmallOrMediumTests(); + } + + public function numberOfTestedClassesAndTraitsBySmallOrMediumOrLargeTests(): int + { + return $this->numberOfTestedClassesBySmallOrMediumOrLargeTests() + $this->numberOfTestedTraitsBySmallOrMediumOrLargeTests(); + } + /** * @return array */ @@ -179,6 +244,31 @@ public function numberOfTestedFunctionsAndMethods(): int return $this->numberOfTestedFunctions() + $this->numberOfTestedMethods(); } + public function numberOfTestedFunctionsAndMethodsBySmallTests(): int + { + return $this->numberOfTestedFunctionsBySmallTests() + $this->numberOfTestedMethodsBySmallTests(); + } + + public function numberOfTestedFunctionsAndMethodsByMediumTests(): int + { + return $this->numberOfTestedFunctionsByMediumTests() + $this->numberOfTestedMethodsByMediumTests(); + } + + public function numberOfTestedFunctionsAndMethodsByLargeTests(): int + { + return $this->numberOfTestedFunctionsByLargeTests() + $this->numberOfTestedMethodsByLargeTests(); + } + + public function numberOfTestedFunctionsAndMethodsBySmallOrMediumTests(): int + { + return $this->numberOfTestedFunctionsBySmallOrMediumTests() + $this->numberOfTestedMethodsBySmallOrMediumTests(); + } + + public function numberOfTestedFunctionsAndMethodsBySmallOrMediumOrLargeTests(): int + { + return $this->numberOfTestedFunctionsBySmallOrMediumOrLargeTests() + $this->numberOfTestedMethodsBySmallOrMediumOrLargeTests(); + } + /** * @return non-negative-int */ @@ -218,6 +308,16 @@ abstract public function numberOfExecutableLines(): int; abstract public function numberOfExecutedLines(): int; + abstract public function numberOfExecutedLinesBySmallTests(): int; + + abstract public function numberOfExecutedLinesByMediumTests(): int; + + abstract public function numberOfExecutedLinesByLargeTests(): int; + + abstract public function numberOfExecutedLinesBySmallOrMediumTests(): int; + + abstract public function numberOfExecutedLinesBySmallOrMediumOrLargeTests(): int; + abstract public function numberOfExecutableBranches(): int; abstract public function numberOfExecutedBranches(): int; @@ -230,18 +330,58 @@ abstract public function numberOfClasses(): int; abstract public function numberOfTestedClasses(): int; + abstract public function numberOfTestedClassesBySmallTests(): int; + + abstract public function numberOfTestedClassesByMediumTests(): int; + + abstract public function numberOfTestedClassesByLargeTests(): int; + + abstract public function numberOfTestedClassesBySmallOrMediumTests(): int; + + abstract public function numberOfTestedClassesBySmallOrMediumOrLargeTests(): int; + abstract public function numberOfTraits(): int; abstract public function numberOfTestedTraits(): int; + abstract public function numberOfTestedTraitsBySmallTests(): int; + + abstract public function numberOfTestedTraitsByMediumTests(): int; + + abstract public function numberOfTestedTraitsByLargeTests(): int; + + abstract public function numberOfTestedTraitsBySmallOrMediumTests(): int; + + abstract public function numberOfTestedTraitsBySmallOrMediumOrLargeTests(): int; + abstract public function numberOfMethods(): int; abstract public function numberOfTestedMethods(): int; + abstract public function numberOfTestedMethodsBySmallTests(): int; + + abstract public function numberOfTestedMethodsByMediumTests(): int; + + abstract public function numberOfTestedMethodsByLargeTests(): int; + + abstract public function numberOfTestedMethodsBySmallOrMediumTests(): int; + + abstract public function numberOfTestedMethodsBySmallOrMediumOrLargeTests(): int; + abstract public function numberOfFunctions(): int; abstract public function numberOfTestedFunctions(): int; + abstract public function numberOfTestedFunctionsBySmallTests(): int; + + abstract public function numberOfTestedFunctionsByMediumTests(): int; + + abstract public function numberOfTestedFunctionsByLargeTests(): int; + + abstract public function numberOfTestedFunctionsBySmallOrMediumTests(): int; + + abstract public function numberOfTestedFunctionsBySmallOrMediumOrLargeTests(): int; + private function processId(): void { if ($this->parent === null) { diff --git a/src/Node/Directory.php b/src/Node/Directory.php index a3db15777..d8112095c 100644 --- a/src/Node/Directory.php +++ b/src/Node/Directory.php @@ -56,23 +56,48 @@ final class Directory extends AbstractNode implements IteratorAggregate /** * @var ?array */ - private ?array $functions = null; - private ?LinesOfCode $linesOfCode = null; - private int $numFiles = -1; - private int $numExecutableLines = -1; - private int $numExecutedLines = -1; - private int $numExecutableBranches = -1; - private int $numExecutedBranches = -1; - private int $numExecutablePaths = -1; - private int $numExecutedPaths = -1; - private int $numClasses = -1; - private int $numTestedClasses = -1; - private int $numTraits = -1; - private int $numTestedTraits = -1; - private int $numMethods = -1; - private int $numTestedMethods = -1; - private int $numFunctions = -1; - private int $numTestedFunctions = -1; + private ?array $functions = null; + private ?LinesOfCode $linesOfCode = null; + private int $numFiles = -1; + private int $numExecutableLines = -1; + private int $numExecutedLines = -1; + private int $numExecutedLinesBySmallTests = -1; + private int $numExecutedLinesByMediumTests = -1; + private int $numExecutedLinesByLargeTests = -1; + private int $numExecutedLinesBySmallOrMediumTests = -1; + private int $numExecutedLinesBySmallOrMediumOrLargeTests = -1; + private int $numExecutableBranches = -1; + private int $numExecutedBranches = -1; + private int $numExecutablePaths = -1; + private int $numExecutedPaths = -1; + private int $numClasses = -1; + private int $numTestedClasses = -1; + private int $numTestedClassesBySmallTests = -1; + private int $numTestedClassesByMediumTests = -1; + private int $numTestedClassesByLargeTests = -1; + private int $numTestedClassesBySmallOrMediumTests = -1; + private int $numTestedClassesBySmallOrMediumOrLargeTests = -1; + private int $numTraits = -1; + private int $numTestedTraits = -1; + private int $numTestedTraitsBySmallTests = -1; + private int $numTestedTraitsByMediumTests = -1; + private int $numTestedTraitsByLargeTests = -1; + private int $numTestedTraitsBySmallOrMediumTests = -1; + private int $numTestedTraitsBySmallOrMediumOrLargeTests = -1; + private int $numMethods = -1; + private int $numTestedMethods = -1; + private int $numTestedMethodsBySmallTests = -1; + private int $numTestedMethodsByMediumTests = -1; + private int $numTestedMethodsByLargeTests = -1; + private int $numTestedMethodsBySmallOrMediumTests = -1; + private int $numTestedMethodsBySmallOrMediumOrLargeTests = -1; + private int $numFunctions = -1; + private int $numTestedFunctions = -1; + private int $numTestedFunctionsBySmallTests = -1; + private int $numTestedFunctionsByMediumTests = -1; + private int $numTestedFunctionsByLargeTests = -1; + private int $numTestedFunctionsBySmallOrMediumTests = -1; + private int $numTestedFunctionsBySmallOrMediumOrLargeTests = -1; public function count(): int { @@ -115,8 +140,13 @@ public function addFile(File $file): void $this->children[] = $file; $this->files[] = &$this->children[count($this->children) - 1]; - $this->numExecutableLines = -1; - $this->numExecutedLines = -1; + $this->numExecutableLines = -1; + $this->numExecutedLines = -1; + $this->numExecutedLinesBySmallTests = -1; + $this->numExecutedLinesByMediumTests = -1; + $this->numExecutedLinesByLargeTests = -1; + $this->numExecutedLinesBySmallOrMediumTests = -1; + $this->numExecutedLinesBySmallOrMediumOrLargeTests = -1; } /** @@ -247,6 +277,71 @@ public function numberOfExecutedLines(): int return $this->numExecutedLines; } + public function numberOfExecutedLinesBySmallTests(): int + { + if ($this->numExecutedLinesBySmallTests === -1) { + $this->numExecutedLinesBySmallTests = 0; + + foreach ($this->children as $child) { + $this->numExecutedLinesBySmallTests += $child->numberOfExecutedLinesBySmallTests(); + } + } + + return $this->numExecutedLinesBySmallTests; + } + + public function numberOfExecutedLinesByMediumTests(): int + { + if ($this->numExecutedLinesByMediumTests === -1) { + $this->numExecutedLinesByMediumTests = 0; + + foreach ($this->children as $child) { + $this->numExecutedLinesByMediumTests += $child->numberOfExecutedLinesByMediumTests(); + } + } + + return $this->numExecutedLinesByMediumTests; + } + + public function numberOfExecutedLinesByLargeTests(): int + { + if ($this->numExecutedLinesByLargeTests === -1) { + $this->numExecutedLinesByLargeTests = 0; + + foreach ($this->children as $child) { + $this->numExecutedLinesByLargeTests += $child->numberOfExecutedLinesByLargeTests(); + } + } + + return $this->numExecutedLinesByLargeTests; + } + + public function numberOfExecutedLinesBySmallOrMediumTests(): int + { + if ($this->numExecutedLinesBySmallOrMediumTests === -1) { + $this->numExecutedLinesBySmallOrMediumTests = 0; + + foreach ($this->children as $child) { + $this->numExecutedLinesBySmallOrMediumTests += $child->numberOfExecutedLinesBySmallOrMediumTests(); + } + } + + return $this->numExecutedLinesBySmallOrMediumTests; + } + + public function numberOfExecutedLinesBySmallOrMediumOrLargeTests(): int + { + if ($this->numExecutedLinesBySmallOrMediumOrLargeTests === -1) { + $this->numExecutedLinesBySmallOrMediumOrLargeTests = 0; + + foreach ($this->children as $child) { + $this->numExecutedLinesBySmallOrMediumOrLargeTests += $child->numberOfExecutedLinesBySmallOrMediumOrLargeTests(); + } + } + + return $this->numExecutedLinesBySmallOrMediumOrLargeTests; + } + public function numberOfExecutableBranches(): int { if ($this->numExecutableBranches === -1) { @@ -325,6 +420,71 @@ public function numberOfTestedClasses(): int return $this->numTestedClasses; } + public function numberOfTestedClassesBySmallTests(): int + { + if ($this->numTestedClassesBySmallTests === -1) { + $this->numTestedClassesBySmallTests = 0; + + foreach ($this->children as $child) { + $this->numTestedClassesBySmallTests += $child->numberOfTestedClassesBySmallTests(); + } + } + + return $this->numTestedClassesBySmallTests; + } + + public function numberOfTestedClassesByMediumTests(): int + { + if ($this->numTestedClassesByMediumTests === -1) { + $this->numTestedClassesByMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedClassesByMediumTests += $child->numberOfTestedClassesByMediumTests(); + } + } + + return $this->numTestedClassesByMediumTests; + } + + public function numberOfTestedClassesByLargeTests(): int + { + if ($this->numTestedClassesByLargeTests === -1) { + $this->numTestedClassesByLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedClassesByLargeTests += $child->numberOfTestedClassesByLargeTests(); + } + } + + return $this->numTestedClassesByLargeTests; + } + + public function numberOfTestedClassesBySmallOrMediumTests(): int + { + if ($this->numTestedClassesBySmallOrMediumTests === -1) { + $this->numTestedClassesBySmallOrMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedClassesBySmallOrMediumTests += $child->numberOfTestedClassesBySmallOrMediumTests(); + } + } + + return $this->numTestedClassesBySmallOrMediumTests; + } + + public function numberOfTestedClassesBySmallOrMediumOrLargeTests(): int + { + if ($this->numTestedClassesBySmallOrMediumOrLargeTests === -1) { + $this->numTestedClassesBySmallOrMediumOrLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedClassesBySmallOrMediumOrLargeTests += $child->numberOfTestedClassesBySmallOrMediumOrLargeTests(); + } + } + + return $this->numTestedClassesBySmallOrMediumOrLargeTests; + } + public function numberOfTraits(): int { if ($this->numTraits === -1) { @@ -351,6 +511,71 @@ public function numberOfTestedTraits(): int return $this->numTestedTraits; } + public function numberOfTestedTraitsBySmallTests(): int + { + if ($this->numTestedTraitsBySmallTests === -1) { + $this->numTestedTraitsBySmallTests = 0; + + foreach ($this->children as $child) { + $this->numTestedTraitsBySmallTests += $child->numberOfTestedTraitsBySmallTests(); + } + } + + return $this->numTestedTraitsBySmallTests; + } + + public function numberOfTestedTraitsByMediumTests(): int + { + if ($this->numTestedTraitsByMediumTests === -1) { + $this->numTestedTraitsByMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedTraitsByMediumTests += $child->numberOfTestedTraitsByMediumTests(); + } + } + + return $this->numTestedTraitsByMediumTests; + } + + public function numberOfTestedTraitsByLargeTests(): int + { + if ($this->numTestedTraitsByLargeTests === -1) { + $this->numTestedTraitsByLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedTraitsByLargeTests += $child->numberOfTestedTraitsByLargeTests(); + } + } + + return $this->numTestedTraitsByLargeTests; + } + + public function numberOfTestedTraitsBySmallOrMediumTests(): int + { + if ($this->numTestedTraitsBySmallOrMediumTests === -1) { + $this->numTestedTraitsBySmallOrMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedTraitsBySmallOrMediumTests += $child->numberOfTestedTraitsBySmallOrMediumTests(); + } + } + + return $this->numTestedTraitsBySmallOrMediumTests; + } + + public function numberOfTestedTraitsBySmallOrMediumOrLargeTests(): int + { + if ($this->numTestedTraitsBySmallOrMediumOrLargeTests === -1) { + $this->numTestedTraitsBySmallOrMediumOrLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedTraitsBySmallOrMediumOrLargeTests += $child->numberOfTestedTraitsBySmallOrMediumOrLargeTests(); + } + } + + return $this->numTestedTraitsBySmallOrMediumOrLargeTests; + } + public function numberOfMethods(): int { if ($this->numMethods === -1) { @@ -377,6 +602,71 @@ public function numberOfTestedMethods(): int return $this->numTestedMethods; } + public function numberOfTestedMethodsBySmallTests(): int + { + if ($this->numTestedMethodsBySmallTests === -1) { + $this->numTestedMethodsBySmallTests = 0; + + foreach ($this->children as $child) { + $this->numTestedMethodsBySmallTests += $child->numberOfTestedMethodsBySmallTests(); + } + } + + return $this->numTestedMethodsBySmallTests; + } + + public function numberOfTestedMethodsByMediumTests(): int + { + if ($this->numTestedMethodsByMediumTests === -1) { + $this->numTestedMethodsByMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedMethodsByMediumTests += $child->numberOfTestedMethodsByMediumTests(); + } + } + + return $this->numTestedMethodsByMediumTests; + } + + public function numberOfTestedMethodsByLargeTests(): int + { + if ($this->numTestedMethodsByLargeTests === -1) { + $this->numTestedMethodsByLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedMethodsByLargeTests += $child->numberOfTestedMethodsByLargeTests(); + } + } + + return $this->numTestedMethodsByLargeTests; + } + + public function numberOfTestedMethodsBySmallOrMediumTests(): int + { + if ($this->numTestedMethodsBySmallOrMediumTests === -1) { + $this->numTestedMethodsBySmallOrMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedMethodsBySmallOrMediumTests += $child->numberOfTestedMethodsBySmallOrMediumTests(); + } + } + + return $this->numTestedMethodsBySmallOrMediumTests; + } + + public function numberOfTestedMethodsBySmallOrMediumOrLargeTests(): int + { + if ($this->numTestedMethodsBySmallOrMediumOrLargeTests === -1) { + $this->numTestedMethodsBySmallOrMediumOrLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedMethodsBySmallOrMediumOrLargeTests += $child->numberOfTestedMethodsBySmallOrMediumOrLargeTests(); + } + } + + return $this->numTestedMethodsBySmallOrMediumOrLargeTests; + } + public function numberOfFunctions(): int { if ($this->numFunctions === -1) { @@ -402,4 +692,69 @@ public function numberOfTestedFunctions(): int return $this->numTestedFunctions; } + + public function numberOfTestedFunctionsBySmallTests(): int + { + if ($this->numTestedFunctionsBySmallTests === -1) { + $this->numTestedFunctionsBySmallTests = 0; + + foreach ($this->children as $child) { + $this->numTestedFunctionsBySmallTests += $child->numberOfTestedFunctionsBySmallTests(); + } + } + + return $this->numTestedFunctionsBySmallTests; + } + + public function numberOfTestedFunctionsByMediumTests(): int + { + if ($this->numTestedFunctionsByMediumTests === -1) { + $this->numTestedFunctionsByMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedFunctionsByMediumTests += $child->numberOfTestedFunctionsByMediumTests(); + } + } + + return $this->numTestedFunctionsByMediumTests; + } + + public function numberOfTestedFunctionsByLargeTests(): int + { + if ($this->numTestedFunctionsByLargeTests === -1) { + $this->numTestedFunctionsByLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedFunctionsByLargeTests += $child->numberOfTestedFunctionsByLargeTests(); + } + } + + return $this->numTestedFunctionsByLargeTests; + } + + public function numberOfTestedFunctionsBySmallOrMediumTests(): int + { + if ($this->numTestedFunctionsBySmallOrMediumTests === -1) { + $this->numTestedFunctionsBySmallOrMediumTests = 0; + + foreach ($this->children as $child) { + $this->numTestedFunctionsBySmallOrMediumTests += $child->numberOfTestedFunctionsBySmallOrMediumTests(); + } + } + + return $this->numTestedFunctionsBySmallOrMediumTests; + } + + public function numberOfTestedFunctionsBySmallOrMediumOrLargeTests(): int + { + if ($this->numTestedFunctionsBySmallOrMediumOrLargeTests === -1) { + $this->numTestedFunctionsBySmallOrMediumOrLargeTests = 0; + + foreach ($this->children as $child) { + $this->numTestedFunctionsBySmallOrMediumOrLargeTests += $child->numberOfTestedFunctionsBySmallOrMediumOrLargeTests(); + } + } + + return $this->numTestedFunctionsBySmallOrMediumOrLargeTests; + } } diff --git a/src/Node/File.php b/src/Node/File.php index 782955d28..3ca732f66 100644 --- a/src/Node/File.php +++ b/src/Node/File.php @@ -56,12 +56,17 @@ final class File extends AbstractNode * @var array */ private readonly array $testData; - private int $numExecutableLines = 0; - private int $numExecutedLines = 0; - private int $numExecutableBranches = 0; - private int $numExecutedBranches = 0; - private int $numExecutablePaths = 0; - private int $numExecutedPaths = 0; + private int $numExecutableLines = 0; + private int $numExecutedLines = 0; + private int $numExecutedLinesBySmallTests = 0; + private int $numExecutedLinesByMediumTests = 0; + private int $numExecutedLinesByLargeTests = 0; + private int $numExecutedLinesBySmallOrMediumTests = 0; + private int $numExecutedLinesBySmallOrMediumOrLargeTests = 0; + private int $numExecutableBranches = 0; + private int $numExecutedBranches = 0; + private int $numExecutablePaths = 0; + private int $numExecutedPaths = 0; /** * @var array @@ -78,13 +83,33 @@ final class File extends AbstractNode */ private array $functions = []; private readonly LinesOfCode $linesOfCode; - private ?int $numClasses = null; - private int $numTestedClasses = 0; - private ?int $numTraits = null; - private int $numTestedTraits = 0; - private ?int $numMethods = null; - private ?int $numTestedMethods = null; - private ?int $numTestedFunctions = null; + private ?int $numClasses = null; + private int $numTestedClasses = 0; + private int $numTestedClassesBySmallTests = 0; + private int $numTestedClassesByMediumTests = 0; + private int $numTestedClassesByLargeTests = 0; + private int $numTestedClassesBySmallOrMediumTests = 0; + private int $numTestedClassesBySmallOrMediumOrLargeTests = 0; + private ?int $numTraits = null; + private int $numTestedTraits = 0; + private int $numTestedTraitsBySmallTests = 0; + private int $numTestedTraitsByMediumTests = 0; + private int $numTestedTraitsByLargeTests = 0; + private int $numTestedTraitsBySmallOrMediumTests = 0; + private int $numTestedTraitsBySmallOrMediumOrLargeTests = 0; + private ?int $numMethods = null; + private ?int $numTestedMethods = null; + private ?int $numTestedMethodsBySmallTests = null; + private ?int $numTestedMethodsByMediumTests = null; + private ?int $numTestedMethodsByLargeTests = null; + private ?int $numTestedMethodsBySmallOrMediumTests = null; + private ?int $numTestedMethodsBySmallOrMediumOrLargeTests = null; + private ?int $numTestedFunctions = null; + private ?int $numTestedFunctionsBySmallTests = null; + private ?int $numTestedFunctionsByMediumTests = null; + private ?int $numTestedFunctionsByLargeTests = null; + private ?int $numTestedFunctionsBySmallOrMediumTests = null; + private ?int $numTestedFunctionsBySmallOrMediumOrLargeTests = null; /** * @var array> @@ -189,6 +214,31 @@ public function numberOfExecutedLines(): int return $this->numExecutedLines; } + public function numberOfExecutedLinesBySmallTests(): int + { + return $this->numExecutedLinesBySmallTests; + } + + public function numberOfExecutedLinesByMediumTests(): int + { + return $this->numExecutedLinesByMediumTests; + } + + public function numberOfExecutedLinesByLargeTests(): int + { + return $this->numExecutedLinesByLargeTests; + } + + public function numberOfExecutedLinesBySmallOrMediumTests(): int + { + return $this->numExecutedLinesBySmallOrMediumTests; + } + + public function numberOfExecutedLinesBySmallOrMediumOrLargeTests(): int + { + return $this->numExecutedLinesBySmallOrMediumOrLargeTests; + } + public function numberOfExecutableBranches(): int { return $this->numExecutableBranches; @@ -233,6 +283,31 @@ public function numberOfTestedClasses(): int return $this->numTestedClasses; } + public function numberOfTestedClassesBySmallTests(): int + { + return $this->numTestedClassesBySmallTests; + } + + public function numberOfTestedClassesByMediumTests(): int + { + return $this->numTestedClassesByMediumTests; + } + + public function numberOfTestedClassesByLargeTests(): int + { + return $this->numTestedClassesByLargeTests; + } + + public function numberOfTestedClassesBySmallOrMediumTests(): int + { + return $this->numTestedClassesBySmallOrMediumTests; + } + + public function numberOfTestedClassesBySmallOrMediumOrLargeTests(): int + { + return $this->numTestedClassesBySmallOrMediumOrLargeTests; + } + public function numberOfTraits(): int { if ($this->numTraits === null) { @@ -257,6 +332,31 @@ public function numberOfTestedTraits(): int return $this->numTestedTraits; } + public function numberOfTestedTraitsBySmallTests(): int + { + return $this->numTestedTraitsBySmallTests; + } + + public function numberOfTestedTraitsByMediumTests(): int + { + return $this->numTestedTraitsByMediumTests; + } + + public function numberOfTestedTraitsByLargeTests(): int + { + return $this->numTestedTraitsByLargeTests; + } + + public function numberOfTestedTraitsBySmallOrMediumTests(): int + { + return $this->numTestedTraitsBySmallOrMediumTests; + } + + public function numberOfTestedTraitsBySmallOrMediumOrLargeTests(): int + { + return $this->numTestedTraitsBySmallOrMediumOrLargeTests; + } + public function numberOfMethods(): int { if ($this->numMethods === null) { @@ -309,6 +409,131 @@ public function numberOfTestedMethods(): int return $this->numTestedMethods; } + public function numberOfTestedMethodsBySmallTests(): int + { + if ($this->numTestedMethodsBySmallTests === null) { + $this->numTestedMethodsBySmallTests = 0; + + foreach ($this->classes as $class) { + foreach ($class->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesBySmallTests === $method->executableLines) { + $this->numTestedMethodsBySmallTests++; + } + } + } + + foreach ($this->traits as $trait) { + foreach ($trait->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesBySmallTests === $method->executableLines) { + $this->numTestedMethodsBySmallTests++; + } + } + } + } + + return $this->numTestedMethodsBySmallTests; + } + + public function numberOfTestedMethodsByMediumTests(): int + { + if ($this->numTestedMethodsByMediumTests === null) { + $this->numTestedMethodsByMediumTests = 0; + + foreach ($this->classes as $class) { + foreach ($class->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesByMediumTests === $method->executableLines) { + $this->numTestedMethodsByMediumTests++; + } + } + } + + foreach ($this->traits as $trait) { + foreach ($trait->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesByMediumTests === $method->executableLines) { + $this->numTestedMethodsByMediumTests++; + } + } + } + } + + return $this->numTestedMethodsByMediumTests; + } + + public function numberOfTestedMethodsByLargeTests(): int + { + if ($this->numTestedMethodsByLargeTests === null) { + $this->numTestedMethodsByLargeTests = 0; + + foreach ($this->classes as $class) { + foreach ($class->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesByLargeTests === $method->executableLines) { + $this->numTestedMethodsByLargeTests++; + } + } + } + + foreach ($this->traits as $trait) { + foreach ($trait->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesByLargeTests === $method->executableLines) { + $this->numTestedMethodsByLargeTests++; + } + } + } + } + + return $this->numTestedMethodsByLargeTests; + } + + public function numberOfTestedMethodsBySmallOrMediumTests(): int + { + if ($this->numTestedMethodsBySmallOrMediumTests === null) { + $this->numTestedMethodsBySmallOrMediumTests = 0; + + foreach ($this->classes as $class) { + foreach ($class->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesBySmallOrMediumTests === $method->executableLines) { + $this->numTestedMethodsBySmallOrMediumTests++; + } + } + } + + foreach ($this->traits as $trait) { + foreach ($trait->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesBySmallOrMediumTests === $method->executableLines) { + $this->numTestedMethodsBySmallOrMediumTests++; + } + } + } + } + + return $this->numTestedMethodsBySmallOrMediumTests; + } + + public function numberOfTestedMethodsBySmallOrMediumOrLargeTests(): int + { + if ($this->numTestedMethodsBySmallOrMediumOrLargeTests === null) { + $this->numTestedMethodsBySmallOrMediumOrLargeTests = 0; + + foreach ($this->classes as $class) { + foreach ($class->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesBySmallOrMediumOrLargeTests === $method->executableLines) { + $this->numTestedMethodsBySmallOrMediumOrLargeTests++; + } + } + } + + foreach ($this->traits as $trait) { + foreach ($trait->methods as $method) { + if ($method->executableLines > 0 && $method->executedLinesBySmallOrMediumOrLargeTests === $method->executableLines) { + $this->numTestedMethodsBySmallOrMediumOrLargeTests++; + } + } + } + } + + return $this->numTestedMethodsBySmallOrMediumOrLargeTests; + } + public function numberOfFunctions(): int { return count($this->functions); @@ -330,6 +555,81 @@ public function numberOfTestedFunctions(): int return $this->numTestedFunctions; } + public function numberOfTestedFunctionsBySmallTests(): int + { + if ($this->numTestedFunctionsBySmallTests === null) { + $this->numTestedFunctionsBySmallTests = 0; + + foreach ($this->functions as $function) { + if ($function->executableLines > 0 && $function->executedLinesBySmallTests === $function->executableLines) { + $this->numTestedFunctionsBySmallTests++; + } + } + } + + return $this->numTestedFunctionsBySmallTests; + } + + public function numberOfTestedFunctionsByMediumTests(): int + { + if ($this->numTestedFunctionsByMediumTests === null) { + $this->numTestedFunctionsByMediumTests = 0; + + foreach ($this->functions as $function) { + if ($function->executableLines > 0 && $function->executedLinesByMediumTests === $function->executableLines) { + $this->numTestedFunctionsByMediumTests++; + } + } + } + + return $this->numTestedFunctionsByMediumTests; + } + + public function numberOfTestedFunctionsByLargeTests(): int + { + if ($this->numTestedFunctionsByLargeTests === null) { + $this->numTestedFunctionsByLargeTests = 0; + + foreach ($this->functions as $function) { + if ($function->executableLines > 0 && $function->executedLinesByLargeTests === $function->executableLines) { + $this->numTestedFunctionsByLargeTests++; + } + } + } + + return $this->numTestedFunctionsByLargeTests; + } + + public function numberOfTestedFunctionsBySmallOrMediumTests(): int + { + if ($this->numTestedFunctionsBySmallOrMediumTests === null) { + $this->numTestedFunctionsBySmallOrMediumTests = 0; + + foreach ($this->functions as $function) { + if ($function->executableLines > 0 && $function->executedLinesBySmallOrMediumTests === $function->executableLines) { + $this->numTestedFunctionsBySmallOrMediumTests++; + } + } + } + + return $this->numTestedFunctionsBySmallOrMediumTests; + } + + public function numberOfTestedFunctionsBySmallOrMediumOrLargeTests(): int + { + if ($this->numTestedFunctionsBySmallOrMediumOrLargeTests === null) { + $this->numTestedFunctionsBySmallOrMediumOrLargeTests = 0; + + foreach ($this->functions as $function) { + if ($function->executableLines > 0 && $function->executedLinesBySmallOrMediumOrLargeTests === $function->executableLines) { + $this->numTestedFunctionsBySmallOrMediumOrLargeTests++; + } + } + } + + return $this->numTestedFunctionsBySmallOrMediumOrLargeTests; + } + /** * @param array $classes * @param array $traits @@ -363,6 +663,74 @@ private function calculateStatistics(array $classes, array $traits, array $funct unset($codeUnit); $this->numExecutedLines++; + + $coveredBySmall = false; + $coveredByMedium = false; + $coveredByLarge = false; + + foreach ($this->lineCoverageData[$lineNumber] as $testId) { + if (isset($this->testData[$testId])) { + $size = $this->testData[$testId]['size']; + + if ($size === 'small') { + $coveredBySmall = true; + } elseif ($size === 'medium') { + $coveredByMedium = true; + } elseif ($size === 'large') { + $coveredByLarge = true; + } + } + } + + if ($coveredBySmall) { + $this->numExecutedLinesBySmallTests++; + + foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { + $codeUnit->executedLinesBySmallTests++; + } + + unset($codeUnit); + } + + if ($coveredByMedium) { + $this->numExecutedLinesByMediumTests++; + + foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { + $codeUnit->executedLinesByMediumTests++; + } + + unset($codeUnit); + } + + if ($coveredByLarge) { + $this->numExecutedLinesByLargeTests++; + + foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { + $codeUnit->executedLinesByLargeTests++; + } + + unset($codeUnit); + } + + if ($coveredBySmall || $coveredByMedium) { + $this->numExecutedLinesBySmallOrMediumTests++; + + foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { + $codeUnit->executedLinesBySmallOrMediumTests++; + } + + unset($codeUnit); + } + + if ($coveredBySmall || $coveredByMedium || $coveredByLarge) { + $this->numExecutedLinesBySmallOrMediumOrLargeTests++; + + foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { + $codeUnit->executedLinesBySmallOrMediumOrLargeTests++; + } + + unset($codeUnit); + } } } } @@ -391,6 +759,26 @@ private function calculateStatistics(array $classes, array $traits, array $funct if ($trait->executableLines > 0 && $trait->coverage === 100) { $this->numTestedTraits++; } + + if ($trait->executableLines > 0 && $trait->executedLinesBySmallTests === $trait->executableLines) { + $this->numTestedTraitsBySmallTests++; + } + + if ($trait->executableLines > 0 && $trait->executedLinesByMediumTests === $trait->executableLines) { + $this->numTestedTraitsByMediumTests++; + } + + if ($trait->executableLines > 0 && $trait->executedLinesByLargeTests === $trait->executableLines) { + $this->numTestedTraitsByLargeTests++; + } + + if ($trait->executableLines > 0 && $trait->executedLinesBySmallOrMediumTests === $trait->executableLines) { + $this->numTestedTraitsBySmallOrMediumTests++; + } + + if ($trait->executableLines > 0 && $trait->executedLinesBySmallOrMediumOrLargeTests === $trait->executableLines) { + $this->numTestedTraitsBySmallOrMediumOrLargeTests++; + } } unset($trait); @@ -419,6 +807,26 @@ private function calculateStatistics(array $classes, array $traits, array $funct if ($class->executableLines > 0 && $class->coverage === 100) { $this->numTestedClasses++; } + + if ($class->executableLines > 0 && $class->executedLinesBySmallTests === $class->executableLines) { + $this->numTestedClassesBySmallTests++; + } + + if ($class->executableLines > 0 && $class->executedLinesByMediumTests === $class->executableLines) { + $this->numTestedClassesByMediumTests++; + } + + if ($class->executableLines > 0 && $class->executedLinesByLargeTests === $class->executableLines) { + $this->numTestedClassesByLargeTests++; + } + + if ($class->executableLines > 0 && $class->executedLinesBySmallOrMediumTests === $class->executableLines) { + $this->numTestedClassesBySmallOrMediumTests++; + } + + if ($class->executableLines > 0 && $class->executedLinesBySmallOrMediumOrLargeTests === $class->executableLines) { + $this->numTestedClassesBySmallOrMediumOrLargeTests++; + } } unset($class); @@ -434,6 +842,26 @@ private function calculateStatistics(array $classes, array $traits, array $funct if ($function->coverage === 100) { $this->numTestedFunctions++; } + + if ($function->executableLines > 0 && $function->executedLinesBySmallTests === $function->executableLines) { + $this->numTestedFunctionsBySmallTests++; + } + + if ($function->executableLines > 0 && $function->executedLinesByMediumTests === $function->executableLines) { + $this->numTestedFunctionsByMediumTests++; + } + + if ($function->executableLines > 0 && $function->executedLinesByLargeTests === $function->executableLines) { + $this->numTestedFunctionsByLargeTests++; + } + + if ($function->executableLines > 0 && $function->executedLinesBySmallOrMediumTests === $function->executableLines) { + $this->numTestedFunctionsBySmallOrMediumTests++; + } + + if ($function->executableLines > 0 && $function->executedLinesBySmallOrMediumOrLargeTests === $function->executableLines) { + $this->numTestedFunctionsBySmallOrMediumOrLargeTests++; + } } } diff --git a/src/Report/Html/Facade.php b/src/Report/Html/Facade.php index 978b7b785..31afa1437 100644 --- a/src/Report/Html/Facade.php +++ b/src/Report/Html/Facade.php @@ -113,6 +113,7 @@ private function copyFiles(string $target): void copy($this->templatePath . 'js/bootstrap.bundle.min.js', $dir . 'bootstrap.bundle.min.js'); copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js'); copy($this->templatePath . 'js/file.js', $dir . 'file.js'); + copy($this->templatePath . 'js/test-size-filter.js', $dir . 'test-size-filter.js'); } private function renderCss(string $target): void diff --git a/src/Report/Html/Renderer.php b/src/Report/Html/Renderer.php index 29b01dc68..51703a3c2 100644 --- a/src/Report/Html/Renderer.php +++ b/src/Report/Html/Renderer.php @@ -9,8 +9,12 @@ */ namespace SebastianBergmann\CodeCoverage\Report\Html; +use const ENT_COMPAT; +use const JSON_THROW_ON_ERROR; use function array_pop; use function count; +use function htmlspecialchars; +use function json_encode; use function sprintf; use function str_repeat; use function substr_count; @@ -138,6 +142,7 @@ protected function renderItemTemplate(Template $template, array $data): string 'icon' => $data['icon'] ?? '', 'crap' => $data['crap'] ?? '', 'name' => $data['name'], + 'coverage_data' => htmlspecialchars($data['coverageDataJson'] ?? '{}', ENT_COMPAT), 'lines_bar' => $linesBar, 'lines_executed_percent' => $data['linesExecutedPercentAsString'], 'lines_level' => $linesLevel, @@ -277,6 +282,14 @@ protected function colorLevel(float $percent): string return 'success'; } + /** + * @param array $data + */ + protected function buildCoverageDataJson(array $data): string + { + return json_encode($data, JSON_THROW_ON_ERROR); + } + private function runtimeString(): string { $runtime = new Runtime; diff --git a/src/Report/Html/Renderer/Directory.php b/src/Report/Html/Renderer/Directory.php index f38b8550e..2f245ca11 100644 --- a/src/Report/Html/Renderer/Directory.php +++ b/src/Report/Html/Renderer/Directory.php @@ -83,6 +83,29 @@ private function renderItem(Node $node, bool $total = false): string 'testedMethodsPercentAsString' => $node->percentageOfTestedFunctionsAndMethods()->asString(), 'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(), 'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString(), + 'coverageDataJson' => $this->buildCoverageDataJson([ + 'linesTotal' => $node->numberOfExecutableLines(), + 'linesAll' => $node->numberOfExecutedLines(), + 'linesSmall' => $node->numberOfExecutedLinesBySmallTests(), + 'linesMedium' => $node->numberOfExecutedLinesByMediumTests(), + 'linesLarge' => $node->numberOfExecutedLinesByLargeTests(), + 'linesSM' => $node->numberOfExecutedLinesBySmallOrMediumTests(), + 'linesSML' => $node->numberOfExecutedLinesBySmallOrMediumOrLargeTests(), + 'methodsTotal' => $node->numberOfFunctionsAndMethods(), + 'methodsAll' => $node->numberOfTestedFunctionsAndMethods(), + 'methodsSmall' => $node->numberOfTestedFunctionsAndMethodsBySmallTests(), + 'methodsMedium' => $node->numberOfTestedFunctionsAndMethodsByMediumTests(), + 'methodsLarge' => $node->numberOfTestedFunctionsAndMethodsByLargeTests(), + 'methodsSM' => $node->numberOfTestedFunctionsAndMethodsBySmallOrMediumTests(), + 'methodsSML' => $node->numberOfTestedFunctionsAndMethodsBySmallOrMediumOrLargeTests(), + 'classesTotal' => $node->numberOfClassesAndTraits(), + 'classesAll' => $node->numberOfTestedClassesAndTraits(), + 'classesSmall' => $node->numberOfTestedClassesAndTraitsBySmallTests(), + 'classesMedium' => $node->numberOfTestedClassesAndTraitsByMediumTests(), + 'classesLarge' => $node->numberOfTestedClassesAndTraitsByLargeTests(), + 'classesSM' => $node->numberOfTestedClassesAndTraitsBySmallOrMediumTests(), + 'classesSML' => $node->numberOfTestedClassesAndTraitsBySmallOrMediumOrLargeTests(), + ]), ]; if ($total) { diff --git a/src/Report/Html/Renderer/File.php b/src/Report/Html/Renderer/File.php index 4512f7461..9fc27c796 100644 --- a/src/Report/Html/Renderer/File.php +++ b/src/Report/Html/Renderer/File.php @@ -308,6 +308,29 @@ private function renderItems(FileNode $node): string 'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(), 'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString(), 'crap' => 'CRAP', + 'coverageDataJson' => $this->buildCoverageDataJson([ + 'linesTotal' => $node->numberOfExecutableLines(), + 'linesAll' => $node->numberOfExecutedLines(), + 'linesSmall' => $node->numberOfExecutedLinesBySmallTests(), + 'linesMedium' => $node->numberOfExecutedLinesByMediumTests(), + 'linesLarge' => $node->numberOfExecutedLinesByLargeTests(), + 'linesSM' => $node->numberOfExecutedLinesBySmallOrMediumTests(), + 'linesSML' => $node->numberOfExecutedLinesBySmallOrMediumOrLargeTests(), + 'methodsTotal' => $node->numberOfFunctionsAndMethods(), + 'methodsAll' => $node->numberOfTestedFunctionsAndMethods(), + 'methodsSmall' => $node->numberOfTestedFunctionsAndMethodsBySmallTests(), + 'methodsMedium' => $node->numberOfTestedFunctionsAndMethodsByMediumTests(), + 'methodsLarge' => $node->numberOfTestedFunctionsAndMethodsByLargeTests(), + 'methodsSM' => $node->numberOfTestedFunctionsAndMethodsBySmallOrMediumTests(), + 'methodsSML' => $node->numberOfTestedFunctionsAndMethodsBySmallOrMediumOrLargeTests(), + 'classesTotal' => $node->numberOfClassesAndTraits(), + 'classesAll' => $node->numberOfTestedClassesAndTraits(), + 'classesSmall' => $node->numberOfTestedClassesAndTraitsBySmallTests(), + 'classesMedium' => $node->numberOfTestedClassesAndTraitsByMediumTests(), + 'classesLarge' => $node->numberOfTestedClassesAndTraitsByLargeTests(), + 'classesSM' => $node->numberOfTestedClassesAndTraitsBySmallOrMediumTests(), + 'classesSML' => $node->numberOfTestedClassesAndTraitsBySmallOrMediumOrLargeTests(), + ]), ], ); diff --git a/src/Report/Html/Renderer/Template/directory.html.dist b/src/Report/Html/Renderer/Template/directory.html.dist index f769d2cae..c5bee801a 100644 --- a/src/Report/Html/Renderer/Template/directory.html.dist +++ b/src/Report/Html/Renderer/Template/directory.html.dist @@ -24,6 +24,14 @@
+
+ + + + + + +
@@ -56,5 +64,8 @@

+ + + diff --git a/src/Report/Html/Renderer/Template/directory_branch.html.dist b/src/Report/Html/Renderer/Template/directory_branch.html.dist index a40c2e128..cc095b5f3 100644 --- a/src/Report/Html/Renderer/Template/directory_branch.html.dist +++ b/src/Report/Html/Renderer/Template/directory_branch.html.dist @@ -24,6 +24,14 @@
+
+ + + + + + +
@@ -58,5 +66,8 @@

+ + + diff --git a/src/Report/Html/Renderer/Template/directory_item.html.dist b/src/Report/Html/Renderer/Template/directory_item.html.dist index f6941a437..4eeb61023 100644 --- a/src/Report/Html/Renderer/Template/directory_item.html.dist +++ b/src/Report/Html/Renderer/Template/directory_item.html.dist @@ -1,4 +1,4 @@ - + diff --git a/src/Report/Html/Renderer/Template/directory_item_branch.html.dist b/src/Report/Html/Renderer/Template/directory_item_branch.html.dist index 532a436c2..f5087ceab 100644 --- a/src/Report/Html/Renderer/Template/directory_item_branch.html.dist +++ b/src/Report/Html/Renderer/Template/directory_item_branch.html.dist @@ -1,4 +1,4 @@ - + diff --git a/src/Report/Html/Renderer/Template/file.html.dist b/src/Report/Html/Renderer/Template/file.html.dist index d29103481..448b54367 100644 --- a/src/Report/Html/Renderer/Template/file.html.dist +++ b/src/Report/Html/Renderer/Template/file.html.dist @@ -24,6 +24,14 @@
+
+ + + + + + +
{{icon}}{{name}} {{lines_bar}}
{{lines_executed_percent}}
{{icon}}{{name}} {{lines_bar}}
{{lines_executed_percent}}
@@ -60,5 +68,6 @@ + diff --git a/src/Report/Html/Renderer/Template/file_branch.html.dist b/src/Report/Html/Renderer/Template/file_branch.html.dist index b8bcf3747..1d92ade6f 100644 --- a/src/Report/Html/Renderer/Template/file_branch.html.dist +++ b/src/Report/Html/Renderer/Template/file_branch.html.dist @@ -24,6 +24,14 @@
+
+ + + + + + +
@@ -62,5 +70,6 @@ + diff --git a/src/Report/Html/Renderer/Template/file_item.html.dist b/src/Report/Html/Renderer/Template/file_item.html.dist index b1c0fca48..92157eae4 100644 --- a/src/Report/Html/Renderer/Template/file_item.html.dist +++ b/src/Report/Html/Renderer/Template/file_item.html.dist @@ -1,4 +1,4 @@ - + diff --git a/src/Report/Html/Renderer/Template/file_item_branch.html.dist b/src/Report/Html/Renderer/Template/file_item_branch.html.dist index 505025179..434189ab5 100644 --- a/src/Report/Html/Renderer/Template/file_item_branch.html.dist +++ b/src/Report/Html/Renderer/Template/file_item_branch.html.dist @@ -1,4 +1,4 @@ - + diff --git a/src/Report/Html/Renderer/Template/js/test-size-filter.js b/src/Report/Html/Renderer/Template/js/test-size-filter.js new file mode 100644 index 000000000..5bdfbd793 --- /dev/null +++ b/src/Report/Html/Renderer/Template/js/test-size-filter.js @@ -0,0 +1,155 @@ +$(function () { + var $btnGroup = $('[data-test-size-filter]').first().parent(); + var lowBound = parseFloat($btnGroup.data('low-upper-bound')) || 50; + var highBound = parseFloat($btnGroup.data('high-lower-bound')) || 90; + + function colorLevel(percent) { + if (percent <= lowBound) return 'danger'; + if (percent < highBound) return 'warning'; + return 'success'; + } + + function coverageBar(percent) { + var level = colorLevel(percent); + var p = percent.toFixed(2); + return '
' + + '
' + + '' + p + '% covered (' + level + ')' + + '
'; + } + + function pct(n, total) { + return total > 0 ? (n / total) * 100 : 0; + } + + function applyFilter(filter) { + $('tr[data-coverage]').each(function () { + var $tr = $(this); + var raw = $tr.attr('data-coverage'); + + if (!raw || raw === '{}') return; + + var d; + try { d = JSON.parse(raw); } catch (e) { return; } + + var linesTotal = d.linesTotal || 0; + var methodsTotal = d.methodsTotal || 0; + var classesTotal = d.classesTotal || 0; + + var linesExec, methodsTested, classesTested; + + if (filter === 'small') { + linesExec = d.linesSmall || 0; + methodsTested = d.methodsSmall || 0; + classesTested = d.classesSmall || 0; + } else if (filter === 'medium') { + linesExec = d.linesMedium || 0; + methodsTested = d.methodsMedium || 0; + classesTested = d.classesMedium || 0; + } else if (filter === 'large') { + linesExec = d.linesLarge || 0; + methodsTested = d.methodsLarge || 0; + classesTested = d.classesLarge || 0; + } else if (filter === 'small+medium') { + linesExec = d.linesSM || 0; + methodsTested = d.methodsSM || 0; + classesTested = d.classesSM || 0; + } else if (filter === 'small+medium+large') { + linesExec = d.linesSML || 0; + methodsTested = d.methodsSML || 0; + classesTested = d.classesSML || 0; + } else { + linesExec = d.linesAll || 0; + methodsTested = d.methodsAll || 0; + classesTested = d.classesAll || 0; + } + + var linesPct = pct(linesExec, linesTotal); + var methodsPct = pct(methodsTested, methodsTotal); + var classesPct = pct(classesTested, classesTotal); + + var cells = $tr.children('td'); + var nameCell = cells.eq(0); + var idx = 1; + + // Lines: bar, percent, number (3 cells) + var linesLevel = linesTotal > 0 ? colorLevel(linesPct) : ''; + + cells.eq(idx).attr('class', linesLevel + ' big').html(linesTotal > 0 ? coverageBar(linesPct) : ''); + cells.eq(idx + 1).attr('class', linesLevel + ' small').html( + '
' + (linesTotal > 0 ? linesPct.toFixed(2) + '%' : 'n/a') + '
' + ); + cells.eq(idx + 2).attr('class', linesLevel + ' small').html( + '
' + linesExec + ' / ' + linesTotal + '
' + ); + idx += 3; + + // Branches (if present): bar, percent, number (3 cells) - skip, don't modify + // Paths (if present): bar, percent, number (3 cells) - skip, don't modify + // We need to find where methods start. Methods are identified by having the methods data. + // For branch views: lines(3) + branches(3) + paths(3) + methods(3+crap) + classes(3) + // For non-branch: lines(3) + methods(3+crap?) + classes(3) + + // Detect if this is a branch view by checking total cell count + var totalCells = cells.length; + var methodsIdx, classesIdx, hasClasses; + + if (totalCells >= 16) { + // Branch view: name(1) + lines(3) + branches(3) + paths(3) + methods(3+crap) + classes(3) + methodsIdx = 10; + classesIdx = 14; + hasClasses = totalCells >= 17; + } else if (totalCells >= 11) { + // Non-branch file view: name(1) + lines(3) + methods(3+crap) + classes(3) + methodsIdx = 4; + classesIdx = 8; + hasClasses = true; + } else if (totalCells >= 10) { + // Directory view: name(1) + lines(3) + methods(3) + classes(3) + methodsIdx = 4; + classesIdx = 7; + hasClasses = true; + } else { + return; + } + + // Methods: bar, percent, number + var methodsLevel = methodsTotal > 0 ? colorLevel(methodsPct) : ''; + + cells.eq(methodsIdx).attr('class', methodsLevel + ' big').html(methodsTotal > 0 ? coverageBar(methodsPct) : ''); + cells.eq(methodsIdx + 1).attr('class', methodsLevel + ' small').html( + '
' + (methodsTotal > 0 ? methodsPct.toFixed(2) + '%' : 'n/a') + '
' + ); + cells.eq(methodsIdx + 2).attr('class', methodsLevel + ' small').html( + '
' + methodsTested + ' / ' + methodsTotal + '
' + ); + + // Classes: bar, percent, number + if (hasClasses && cells.eq(classesIdx).length) { + var classesLevel = classesTotal > 0 ? colorLevel(classesPct) : ''; + + cells.eq(classesIdx).attr('class', classesLevel + ' big').html(classesTotal > 0 ? coverageBar(classesPct) : ''); + cells.eq(classesIdx + 1).attr('class', classesLevel + ' small').html( + '
' + (classesTotal > 0 ? classesPct.toFixed(2) + '%' : 'n/a') + '
' + ); + cells.eq(classesIdx + 2).attr('class', classesLevel + ' small').html( + '
' + classesTested + ' / ' + classesTotal + '
' + ); + } + + // Update name cell background + nameCell.attr('class', linesLevel); + }); + } + + $('[data-test-size-filter]').on('click', function () { + var $btn = $(this); + + $btn.siblings().removeClass('active'); + $btn.addClass('active'); + + applyFilter($btn.data('test-size-filter')); + }); +}); diff --git a/src/Report/Html/Renderer/Template/method_item.html.dist b/src/Report/Html/Renderer/Template/method_item.html.dist index 2311d4564..5f410e5fe 100644 --- a/src/Report/Html/Renderer/Template/method_item.html.dist +++ b/src/Report/Html/Renderer/Template/method_item.html.dist @@ -1,4 +1,4 @@ - + diff --git a/src/Report/Html/Renderer/Template/method_item_branch.html.dist b/src/Report/Html/Renderer/Template/method_item_branch.html.dist index 36d6cb741..cd72ebcfb 100644 --- a/src/Report/Html/Renderer/Template/method_item_branch.html.dist +++ b/src/Report/Html/Renderer/Template/method_item_branch.html.dist @@ -1,4 +1,4 @@ - + diff --git a/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html b/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html index 9c503316d..4a5cbeea5 100644 --- a/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html +++ b/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html @@ -26,6 +26,14 @@
+
+ + + + + + +
{{name}} {{lines_bar}}
{{lines_executed_percent}}
{{name}} {{lines_bar}}
{{lines_executed_percent}}
{{name}} {{lines_bar}}
{{lines_executed_percent}}
{{name}} {{lines_bar}}
{{lines_executed_percent}}
@@ -41,7 +49,7 @@ - + - + - + - + - + - +
Total
@@ -70,7 +78,7 @@
0 / 1
BankAccount
@@ -99,7 +107,7 @@
0 / 1
 getBalance
@@ -121,7 +129,7 @@
 setBalance
@@ -143,7 +151,7 @@
 depositMoney
@@ -165,7 +173,7 @@
 withdrawMoney
@@ -247,5 +255,6 @@

Legend

+ diff --git a/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html b/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html index 0afe13665..0981c2568 100644 --- a/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html +++ b/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html @@ -160,7 +160,7 @@

 

diff --git a/tests/_files/Report/HTML/CoverageForBankAccount/index.html b/tests/_files/Report/HTML/CoverageForBankAccount/index.html index 1112add13..d1d9ed24b 100644 --- a/tests/_files/Report/HTML/CoverageForBankAccount/index.html +++ b/tests/_files/Report/HTML/CoverageForBankAccount/index.html @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -41,7 +49,7 @@ - + - +
Total
@@ -69,7 +77,7 @@
0 / 1
BankAccount.php
@@ -114,5 +122,8 @@

Legend

+ + + diff --git a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/dashboard.html b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/dashboard.html index 1ba16a678..7e73d8d47 100644 --- a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/dashboard.html +++ b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/dashboard.html @@ -150,7 +150,7 @@

 

diff --git a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html index ff7813e53..3d96a44d6 100644 --- a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html +++ b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -41,7 +49,7 @@ - + - +
Total
@@ -69,7 +77,7 @@
1 / 1
source_with_class_and_anonymous_function.php
@@ -114,5 +122,8 @@

Legend

+ + + diff --git a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html index ff821b35d..7996a90dd 100644 --- a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html +++ b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -41,7 +49,7 @@ - + - + - +
Total
@@ -70,7 +78,7 @@
1 / 1
CoveredClassWithAnonymousFunctionInStaticMethod
@@ -99,7 +107,7 @@
1 / 1
 runAnonymous
@@ -166,5 +174,6 @@

Legend

+ diff --git a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/dashboard.html b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/dashboard.html index 766b18a82..46d1348d3 100644 --- a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/dashboard.html +++ b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/dashboard.html @@ -84,7 +84,7 @@

 

diff --git a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html index 73c808041..5f2cab63e 100644 --- a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html +++ b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -41,7 +49,7 @@ - + - +
Total
@@ -64,7 +72,7 @@
0 / 0
source_with_ignore.php
@@ -104,5 +112,8 @@

Legend

+ + + diff --git a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html index 5b61e5aed..e3378b881 100644 --- a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html +++ b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -41,7 +49,7 @@ - + - + @@ -77,7 +85,7 @@ - + @@ -91,7 +99,7 @@ - + @@ -103,7 +111,7 @@ - + @@ -117,7 +125,7 @@ - + @@ -197,5 +205,6 @@

Legend

+ diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html index 681941ba2..514c50463 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html @@ -2,7 +2,7 @@ - Code Coverage for %sBankAccount.php + Code Coverage for %a @@ -26,6 +26,14 @@
+
+ + + + + + +
Total
@@ -65,7 +73,7 @@
0 / 0
baz
n/a
Foo
n/a
0 / 0
 bar
n/a
Bar
n/a
0 / 0
 foo
n/a
@@ -43,252 +51,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Total
-
- 62.50% covered (warning) -
-
-
62.50%
5 / 8
-
- 42.86% covered (danger) -
-
-
42.86%
3 / 7
-
- 60.00% covered (warning) -
-
-
60.00%
3 / 5
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
CRAP
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
BankAccount
-
- 62.50% covered (warning) -
-
-
62.50%
5 / 8
-
- 42.86% covered (danger) -
-
-
42.86%
3 / 7
-
- 60.00% covered (warning) -
-
-
60.00%
3 / 5
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
6.60
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
 getBalance
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
 setBalance
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 3
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 4
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 2
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
6
 depositMoney
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
 withdrawMoney
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
-
-%a +%a
+
+

Legend

+

Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable

+

+ Generated by php-code-coverage %s using %s at %s. +

+ + + +
+
+ + + + - \ No newline at end of file + diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html index 681941ba2..4568015f3 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html @@ -2,7 +2,7 @@ - Code Coverage for %sBankAccount.php + Code Coverage for %a @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -43,252 +51,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Total
-
- 62.50% covered (warning) -
-
-
62.50%
5 / 8
-
- 42.86% covered (danger) -
-
-
42.86%
3 / 7
-
- 60.00% covered (warning) -
-
-
60.00%
3 / 5
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
CRAP
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
BankAccount
-
- 62.50% covered (warning) -
-
-
62.50%
5 / 8
-
- 42.86% covered (danger) -
-
-
42.86%
3 / 7
-
- 60.00% covered (warning) -
-
-
60.00%
3 / 5
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
6.60
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
 getBalance
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
 setBalance
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 3
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 4
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 2
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
6
 depositMoney
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
 withdrawMoney
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
-
-%a +%a +
+ + + + - \ No newline at end of file + diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html index 681941ba2..4568015f3 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html @@ -2,7 +2,7 @@ - Code Coverage for %sBankAccount.php + Code Coverage for %a @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -43,252 +51,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Total
-
- 62.50% covered (warning) -
-
-
62.50%
5 / 8
-
- 42.86% covered (danger) -
-
-
42.86%
3 / 7
-
- 60.00% covered (warning) -
-
-
60.00%
3 / 5
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
CRAP
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
BankAccount
-
- 62.50% covered (warning) -
-
-
62.50%
5 / 8
-
- 42.86% covered (danger) -
-
-
42.86%
3 / 7
-
- 60.00% covered (warning) -
-
-
60.00%
3 / 5
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
6.60
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
 getBalance
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
 setBalance
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 3
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 4
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 2
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
6
 depositMoney
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
 withdrawMoney
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
-
-%a +%a +
+ + + + - \ No newline at end of file + diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/dashboard.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/dashboard.html index c4e377bf4..8e0d9483e 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/dashboard.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/dashboard.html @@ -160,7 +160,7 @@

 

diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html index f4467d57c..e77950610 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html @@ -16,7 +16,7 @@
+
+ + + + + + +
@@ -43,7 +51,7 @@ - + - +
Total
@@ -87,7 +95,7 @@
0 / 1
BankAccount.php [line] [branch] [path]
@@ -148,5 +156,8 @@

Legend

+ + + diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/dashboard.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/dashboard.html index aefef1c8d..f11a8d229 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/dashboard.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/dashboard.html @@ -81,7 +81,7 @@

 

diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html index 51d43fe05..f0f6b1c17 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -43,7 +51,7 @@ - + - +
Total
@@ -82,7 +90,7 @@
0 / 0
source_without_namespace.php [line] [branch] [path]
@@ -138,5 +146,8 @@

Legend

+ + + diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html index 1446f796d..e49f89381 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html @@ -26,6 +26,14 @@
+
+ + + + + + +
@@ -43,7 +51,7 @@ - + - + - + @@ -185,5 +193,6 @@

Legend

+ diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html index 590d2010b..d85acb034 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html @@ -26,6 +26,14 @@
+
+ + + + + + +
Total
@@ -83,7 +91,7 @@
0 / 0
foo
@@ -121,7 +129,7 @@
Foo
n/a
@@ -43,7 +51,7 @@ - + - + - + @@ -207,7 +215,7 @@
foo
Total
@@ -83,7 +91,7 @@
0 / 0
foo
@@ -121,7 +129,7 @@
Foo
n/a
-
{closure:%ssource_without_namespace.php:14-14}
+
{closure:%s%esource_without_namespace.php:14-14}
@@ -231,5 +239,6 @@

Legend

+ diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html index 640b60b1f..1f457e541 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html @@ -26,6 +26,14 @@
+
+ + + + + + +
14    $baz = function () {};
@@ -43,7 +51,7 @@ - + - + - + @@ -208,7 +216,7 @@
foo
Total
@@ -83,7 +91,7 @@
0 / 0
foo
@@ -121,7 +129,7 @@
Foo
n/a
-
{closure:%ssource_without_namespace.php:14-14}
+
{closure:%s%esource_without_namespace.php:14-14}
@@ -232,5 +240,6 @@

Legend

+
14    $baz = function () {};