Skip to content

Commit

Permalink
Ignore code from code coverage for handling of errors for edge cases …
Browse files Browse the repository at this point in the history
…that I do not know how to test
  • Loading branch information
sebastianbergmann committed Jul 31, 2024
1 parent 8e9e808 commit f8129a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Framework/MockObject/Runtime/ReturnValueGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ private function newInstanceOf(string $stubClassName, string $className, string
{
try {
return (new ReflectionClass($stubClassName))->newInstanceWithoutConstructor();
// @codeCoverageIgnoreStart
} catch (Throwable $t) {
throw new RuntimeException(
sprintf(
Expand All @@ -193,6 +194,7 @@ private function newInstanceOf(string $stubClassName, string $className, string
$t->getMessage(),
),
);
// @codeCoverageIgnoreEnd
}
}

Expand All @@ -207,6 +209,7 @@ private function testDoubleFor(string $type, string $className, string $methodNa
{
try {
return (new Generator)->testDouble($type, false, [], [], '', false);
// @codeCoverageIgnoreStart
} catch (Throwable $t) {
throw new RuntimeException(
sprintf(
Expand All @@ -216,6 +219,7 @@ private function testDoubleFor(string $type, string $className, string $methodNa
$t->getMessage(),
),
);
// @codeCoverageIgnoreEnd
}
}

Expand All @@ -230,6 +234,7 @@ private function testDoubleForIntersectionOfInterfaces(array $types, string $cla
{
try {
return (new Generator)->testDoubleForInterfaceIntersection($types, false);
// @codeCoverageIgnoreStart
} catch (Throwable $t) {
throw new RuntimeException(
sprintf(
Expand All @@ -239,6 +244,7 @@ private function testDoubleForIntersectionOfInterfaces(array $types, string $cla
$t->getMessage(),
),
);
// @codeCoverageIgnoreEnd
}
}
}

0 comments on commit f8129a6

Please sign in to comment.