Skip to content

Commit 42c19c1

Browse files
Ignore error handling code from code coverage for which we cannot trigger the error in a test
1 parent 0fd1f82 commit 42c19c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Util/PHP/DefaultJobRunner.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ public function run(Job $job): Result
4646

4747
if ($temporaryFile === false ||
4848
file_put_contents($temporaryFile, $job->code()) === false) {
49+
// @codeCoverageIgnoreStart
4950
throw new PhpProcessException(
5051
'Unable to write temporary file',
5152
);
53+
// @codeCoverageIgnoreEnd
5254
}
5355

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

113115
if (!is_resource($process)) {
116+
// @codeCoverageIgnoreStart
114117
throw new PhpProcessException(
115118
'Unable to spawn worker process',
116119
);
120+
// @codeCoverageIgnoreEnd
117121
}
118122

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

0 commit comments

Comments
 (0)