xref: /php-src/ext/curl/tests/curl_upkeep_001.phpt (revision 65472c79)
1--TEST--
2curl_upkeep() function
3--EXTENSIONS--
4curl
5--SKIPIF--
6<?php
7if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
8if (curl_version()['version_number'] < 0x073e00) die('skip requires curl >= 7.62.0');
9?>
10--FILE--
11<?php
12
13$url = "https://example.com";
14
15$ch = curl_init();
16curl_setopt($ch,CURLOPT_URL,$url);
17curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
18curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_2_0);
19curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
20curl_setopt($ch, CURLOPT_UPKEEP_INTERVAL_MS, 200);
21if (curl_exec($ch)) {
22    usleep(300);
23    var_dump(curl_upkeep($ch));
24}
25curl_close($ch);
26?>
27--EXPECT--
28bool(true)
29