From 88fc34aa7a3a6319c431114fbf8897e385c4bcf3 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sun, 19 Jan 2025 11:20:15 +0700 Subject: [PATCH] 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. --- ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt index d11e29f078c..58d01df2a88 100644 --- a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt +++ b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt @@ -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"