mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02: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:
parent
252c0c9164
commit
88fc34aa7a
1 changed files with 2 additions and 0 deletions
|
@ -48,6 +48,7 @@ $result = curl_exec($ch);
|
||||||
var_dump($result);
|
var_dump($result);
|
||||||
var_dump(curl_error($ch));
|
var_dump(curl_error($ch));
|
||||||
var_dump(curl_errno($ch));
|
var_dump(curl_errno($ch));
|
||||||
|
var_dump(curl_errno($ch) === CURLE_ABORTED_BY_CALLBACK);
|
||||||
|
|
||||||
$returnValue = CURL_PREREQFUNC_OK;
|
$returnValue = CURL_PREREQFUNC_OK;
|
||||||
|
|
||||||
|
@ -133,6 +134,7 @@ bool(true)
|
||||||
bool(false)
|
bool(false)
|
||||||
string(41) "operation aborted by pre-request callback"
|
string(41) "operation aborted by pre-request callback"
|
||||||
int(42)
|
int(42)
|
||||||
|
bool(true)
|
||||||
|
|
||||||
Testing with CURL_PREREQFUNC_OK
|
Testing with CURL_PREREQFUNC_OK
|
||||||
string(8) "callback"
|
string(8) "callback"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue