diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index ec1ae1ca67..8e4f1c5161 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -475,7 +475,9 @@ final public function runBare(): void $hasMetRequirements = true; if ($this->inIsolation) { + // @codeCoverageIgnoreStart $this->invokeBeforeClassHookMethods($hookMethods, $emitter); + // @codeCoverageIgnoreEnd } if (method_exists(static::class, $this->methodName) && @@ -590,7 +592,9 @@ final public function runBare(): void $this->invokeAfterTestHookMethods($hookMethods, $emitter); if ($this->inIsolation) { + // @codeCoverageIgnoreStart $this->invokeAfterClassHookMethods($hookMethods, $emitter); + // @codeCoverageIgnoreEnd } } } catch (AssertionError|AssertionFailedError $e) { @@ -649,6 +653,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 { @@ -974,6 +980,8 @@ final protected function atMost(int $allowedInvocations): InvokedAtMostCountMatc /** * @deprecated Use $double->willReturn() instead of $double->will($this->returnValue()) * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore */ final protected function returnValue(mixed $value): ReturnStub { @@ -988,6 +996,8 @@ final protected function returnValue(mixed $value): ReturnStub /** * @deprecated Use $double->willReturnMap() instead of $double->will($this->returnValueMap()) * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore */ final protected function returnValueMap(array $valueMap): ReturnValueMapStub { @@ -1002,6 +1012,8 @@ final protected function returnValueMap(array $valueMap): ReturnValueMapStub /** * @deprecated Use $double->willReturnArgument() instead of $double->will($this->returnArgument()) * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore */ final protected function returnArgument(int $argumentIndex): ReturnArgumentStub { @@ -1016,6 +1028,8 @@ final protected function returnArgument(int $argumentIndex): ReturnArgumentStub /** * @deprecated Use $double->willReturnCallback() instead of $double->will($this->returnCallback()) * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore */ final protected function returnCallback(callable $callback): ReturnCallbackStub { @@ -1030,6 +1044,8 @@ final protected function returnCallback(callable $callback): ReturnCallbackStub /** * @deprecated Use $double->willReturnSelf() instead of $double->will($this->returnSelf()) * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore */ final protected function returnSelf(): ReturnSelfStub { @@ -1050,6 +1066,8 @@ final protected function throwException(Throwable $exception): ExceptionStub * @deprecated Use $double->willReturn() instead of $double->will($this->onConsecutiveCalls()) * @see https://github.com/sebastianbergmann/phpunit/issues/5423 * @see https://github.com/sebastianbergmann/phpunit/issues/5425 + * + * @codeCoverageIgnore */ final protected function onConsecutiveCalls(mixed ...$arguments): ConsecutiveCallsStub { @@ -1202,6 +1220,8 @@ final protected function runTest(): mixed * @throws Exception * * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5214 + * + * @codeCoverageIgnore */ final protected function iniSet(string $varName, string $newValue): void { @@ -1232,6 +1252,8 @@ final protected function iniSet(string $varName, string $newValue): void * @throws Exception * * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5216 + * + * @codeCoverageIgnore */ final protected function setLocale(mixed ...$arguments): void { @@ -2227,6 +2249,8 @@ private function performAssertionsOnOutput(): void /** * @throws Throwable + * + * @codeCoverageIgnore */ private function invokeBeforeClassHookMethods(array $hookMethods, Event\Emitter $emitter): void { @@ -2292,6 +2316,8 @@ private function invokeAfterTestHookMethods(array $hookMethods, Event\Emitter $e /** * @throws Throwable + * + * @codeCoverageIgnore */ private function invokeAfterClassHookMethods(array $hookMethods, Event\Emitter $emitter): void {