mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/curl: update CURLOPT_PREREQFUNCTION test to validate CURLE_ABORTED_BY_CALLBACK return value
Updates the `CURLOPT_PREREQFUNCTION` test to validate that connections failed when the PREREQFUNC returns abort returns CURLE_ABORTED_BY_CALLBACK as the error number. Previously, it only checked against a hardcoded value. Now, it checks against the `CURLE_ABORTED_BY_CALLBACK` constant as well.
This commit is contained in:
@@ -48,6 +48,7 @@ $result = curl_exec($ch);
|
||||
var_dump($result);
|
||||
var_dump(curl_error($ch));
|
||||
var_dump(curl_errno($ch));
|
||||
var_dump(curl_errno($ch) === CURLE_ABORTED_BY_CALLBACK);
|
||||
|
||||
$returnValue = CURL_PREREQFUNC_OK;
|
||||
|
||||
@@ -133,6 +134,7 @@ bool(true)
|
||||
bool(false)
|
||||
string(41) "operation aborted by pre-request callback"
|
||||
int(42)
|
||||
bool(true)
|
||||
|
||||
Testing with CURL_PREREQFUNC_OK
|
||||
string(8) "callback"
|
||||
|
||||
Reference in New Issue
Block a user