Skip to content

Commit b99381e

Browse files
committed
test: CURL option force_ip_resolve
1 parent 71267ab commit b99381e

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
@@ -1172,6 +1172,30 @@ public function testHTTPv3(): void
11721172
$this->assertSame(CURL_HTTP_VERSION_3, $options[CURLOPT_HTTP_VERSION]);
11731173
}
11741174

1175+
public function testForceResolveIPv4(): void
1176+
{
1177+
$this->request->request('POST', '/post', [
1178+
'force_ip_resolve' => 'v4',
1179+
]);
1180+
1181+
$options = $this->request->curl_options;
1182+
1183+
$this->assertArrayHasKey(CURLOPT_IPRESOLVE, $options);
1184+
$this->assertSame(CURL_IPRESOLVE_V4, $options[CURLOPT_IPRESOLVE]);
1185+
}
1186+
1187+
public function testForceResolveIPv6(): void
1188+
{
1189+
$this->request->request('POST', '/post', [
1190+
'force_ip_resolve' => 'v6',
1191+
]);
1192+
1193+
$options = $this->request->curl_options;
1194+
1195+
$this->assertArrayHasKey(CURLOPT_IPRESOLVE, $options);
1196+
$this->assertSame(CURL_IPRESOLVE_V6, $options[CURLOPT_IPRESOLVE]);
1197+
}
1198+
11751199
public function testCookieOption(): void
11761200
{
11771201
$holder = SUPPORTPATH . 'HTTP/Files/CookiesHolder.txt';

0 commit comments

Comments
 (0)