1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00
Files
archived-php-src/ext/curl/tests/bug77946.phpt
Ayesh Karunaratne 404803577d ext/curl: Fix failing tests due to string changes in libcurl 8.6.0
Upstream libcurl 8.6.0 contains a change[^1] that caused a test failure.
This fixes it by updating the test's `EXPECTF` to use a regex to account for both string patterns.

[^1]: https://github.com/curl/curl/commit/45cf4755e71f#diff-a8a54563608f8155973318f4ddb61d7328dab512b8ff2b5cc48cc76979d4204cL1683

Closes GH-13293.
2024-01-31 21:58:27 +01:00

38 lines
855 B
PHP

--TEST--
Bug #77946 (Errored cURL resources returned by curl_multi_info_read() must be compatible with curl_errno() and curl_error())
--EXTENSIONS--
curl
--FILE--
<?php
$urls = array(
'unknown://scheme.tld',
);
$mh = curl_multi_init();
foreach ($urls as $i => $url) {
$conn[$i] = curl_init($url);
curl_multi_add_handle($mh, $conn[$i]);
}
do {
$status = curl_multi_exec($mh, $active);
$info = curl_multi_info_read($mh);
if (false !== $info) {
var_dump($info['result']);
var_dump(curl_errno($info['handle']));
var_dump(curl_error($info['handle']));
}
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
foreach ($urls as $i => $url) {
curl_close($conn[$i]);
}
curl_multi_close($mh);
?>
--EXPECTF--
int(1)
int(1)
string(%d) "Protocol %Sunknown%S %rnot supported( or disabled in libcurl)?%r"