Skip to content

Commit

Permalink
Ignore methods from code coverage that are only called when code cove…
Browse files Browse the repository at this point in the history
…rage information cannot be collected
  • Loading branch information
sebastianbergmann committed Apr 28, 2024
1 parent 68ca073 commit 4e25805
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Framework/TestCase.php
Expand Up @@ -666,7 +666,9 @@ final public function runBare(): void
$hasMetRequirements = true;

if ($this->inIsolation) {
// @codeCoverageIgnoreStart
$this->invokeBeforeClassHookMethods($hookMethods, $emitter);
// @codeCoverageIgnoreEnd
}

if (method_exists(static::class, $this->name) &&
Expand Down Expand Up @@ -780,7 +782,9 @@ final public function runBare(): void
$this->invokeAfterTestHookMethods($hookMethods, $emitter);

if ($this->inIsolation) {
// @codeCoverageIgnoreStart
$this->invokeAfterClassHookMethods($hookMethods, $emitter);
// @codeCoverageIgnoreEnd
}
}
} catch (AssertionError|AssertionFailedError $e) {
Expand Down Expand Up @@ -852,6 +856,8 @@ final public function setDependencies(array $dependencies): void

/**
* @internal This method is not covered by the backward compatibility promise for PHPUnit
*
* @codeCoverageIgnore
*/
final public function setDependencyInput(array $dependencyInput): void
{
Expand Down Expand Up @@ -2065,6 +2071,8 @@ private function performAssertionsOnOutput(): void

/**
* @throws Throwable
*
* @codeCoverageIgnore
*/
private function invokeBeforeClassHookMethods(array $hookMethods, Event\Emitter $emitter): void
{
Expand Down Expand Up @@ -2130,6 +2138,8 @@ private function invokeAfterTestHookMethods(array $hookMethods, Event\Emitter $e

/**
* @throws Throwable
*
* @codeCoverageIgnore
*/
private function invokeAfterClassHookMethods(array $hookMethods, Event\Emitter $emitter): void
{
Expand Down

0 comments on commit 4e25805

Please sign in to comment.