Skip to content

Commit 88fc34a

Browse files
committed
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.
1 parent 252c0c9 commit 88fc34a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ $result = curl_exec($ch);
4848
var_dump($result);
4949
var_dump(curl_error($ch));
5050
var_dump(curl_errno($ch));
51+
var_dump(curl_errno($ch) === CURLE_ABORTED_BY_CALLBACK);
5152

5253
$returnValue = CURL_PREREQFUNC_OK;
5354

@@ -133,6 +134,7 @@ bool(true)
133134
bool(false)
134135
string(41) "operation aborted by pre-request callback"
135136
int(42)
137+
bool(true)
136138

137139
Testing with CURL_PREREQFUNC_OK
138140
string(8) "callback"

0 commit comments

Comments
 (0)