Skip to content

Commit ef1a250

Browse files
committed
Curler: Improve code coverage
1 parent 162b97d commit ef1a250

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Toolkit/Curler/CurlerHttpArchiveRecorder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ public function __construct(
5555
$this->Uri = $uri;
5656

5757
if ($name === null && $version === null) {
58+
// @codeCoverageIgnoreStart
5859
$name = Package::name();
5960
$version = Package::version(true, true);
61+
// @codeCoverageIgnoreEnd
6062
}
6163

6264
File::writeAll($this->Stream, sprintf(
@@ -140,7 +142,9 @@ protected function handleCurlResponse(CurlResponseEventInterface $event): void
140142

141143
$request = $event->getRequest();
142144
if ($request !== $this->LastRequest) {
145+
// @codeCoverageIgnoreStart
143146
throw new RuntimeException('Response does not match request');
147+
// @codeCoverageIgnoreEnd
144148
}
145149
$requestTime = $this->LastRequestTime;
146150

@@ -220,7 +224,9 @@ protected function getCurlInfo($handle, int $option)
220224
{
221225
$value = curl_getinfo($handle, $option);
222226
if ($value === false) {
227+
// @codeCoverageIgnoreStart
223228
throw new RuntimeException('Error getting cURL transfer information');
229+
// @codeCoverageIgnoreEnd
224230
}
225231
/** @var mixed[]|int|float|string|null */
226232
return $value;

0 commit comments

Comments
 (0)