Skip to content

Commit 3c88223

Browse files
committed
Add test for curl_upkeep()
1 parent 2e44fa5 commit 3c88223

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

ext/curl/tests/curl_upkeep_001.phpt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
curl_upkeep() function
3+
--EXTENSIONS--
4+
curl
5+
--SKIPIF--
6+
<?php
7+
if (curl_version()['version_number'] < 0x073e00) die('skip requires curl >= 7.62.0');
8+
?>
9+
--FILE--
10+
<?php
11+
12+
$url = "https://example.com";
13+
14+
$ch = curl_init();
15+
curl_setopt($ch,CURLOPT_URL,$url);
16+
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
17+
curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_2_0);
18+
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
19+
curl_setopt($ch, CURLOPT_UPKEEP_INTERVAL_MS, 200);
20+
if (curl_exec($ch)) {
21+
usleep(300);
22+
var_dump(curl_upkeep($ch));
23+
}
24+
curl_close($ch);
25+
?>
26+
--EXPECT--
27+
bool(true)

0 commit comments

Comments
 (0)