Skip to content

Commit 7cd7b0f

Browse files
committed
test: CURL option force_ip_resolve
1 parent 742dbc8 commit 7cd7b0f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/system/HTTP/CURLRequestTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,30 @@ public function testHTTPv3(): void
11871187
$this->assertSame(CURL_HTTP_VERSION_3, $options[CURLOPT_HTTP_VERSION]);
11881188
}
11891189

1190+
public function testForceResolveIPv4(): void
1191+
{
1192+
$this->request->request('POST', '/post', [
1193+
'force_ip_resolve' => 'v4',
1194+
]);
1195+
1196+
$options = $this->request->curl_options;
1197+
1198+
$this->assertArrayHasKey(CURLOPT_IPRESOLVE, $options);
1199+
$this->assertSame(CURL_IPRESOLVE_V4, $options[CURLOPT_IPRESOLVE]);
1200+
}
1201+
1202+
public function testForceResolveIPv6(): void
1203+
{
1204+
$this->request->request('POST', '/post', [
1205+
'force_ip_resolve' => 'v6',
1206+
]);
1207+
1208+
$options = $this->request->curl_options;
1209+
1210+
$this->assertArrayHasKey(CURLOPT_IPRESOLVE, $options);
1211+
$this->assertSame(CURL_IPRESOLVE_V6, $options[CURLOPT_IPRESOLVE]);
1212+
}
1213+
11901214
public function testCookieOption(): void
11911215
{
11921216
$holder = SUPPORTPATH . 'HTTP/Files/CookiesHolder.txt';

0 commit comments

Comments
 (0)