Skip to content

Commit

Permalink
Ignore error handling code from code coverage for which we cannot tri…
Browse files Browse the repository at this point in the history
…gger the error in a test
  • Loading branch information
sebastianbergmann committed May 14, 2024
1 parent 0fd1f82 commit 42c19c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Util/PHP/DefaultJobRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public function run(Job $job): Result

if ($temporaryFile === false ||
file_put_contents($temporaryFile, $job->code()) === false) {
// @codeCoverageIgnoreStart
throw new PhpProcessException(
'Unable to write temporary file',
);
// @codeCoverageIgnoreEnd
}

$job = new Job(
Expand Down Expand Up @@ -111,9 +113,11 @@ private function runProcess(Job $job, ?string $temporaryFile): Result
);

if (!is_resource($process)) {
// @codeCoverageIgnoreStart
throw new PhpProcessException(
'Unable to spawn worker process',
);
// @codeCoverageIgnoreEnd
}

fwrite($pipes[0], $job->code());
Expand Down

0 comments on commit 42c19c1

Please sign in to comment.