From ef21243994bdc9b9ee7e29d31e2cee0c618bae7d Mon Sep 17 00:00:00 2001 From: NickSdot Date: Sun, 9 Aug 2026 15:12:28 +0700 Subject: [PATCH] ext/curl: improved tests Follow up to #22908. --- ext/curl/tests/bug48207.phpt | 10 +++++----- ext/curl/tests/bug68089.phpt | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/curl/tests/bug48207.phpt b/ext/curl/tests/bug48207.phpt index 6487076e9ee3..29e99a5e9572 100644 --- a/ext/curl/tests/bug48207.phpt +++ b/ext/curl/tests/bug48207.phpt @@ -44,8 +44,8 @@ foreach ([ ] as $option) { try { curl_setopt($ch, $option, $fp); - } catch (ValueError $exception) { - echo $exception->getMessage(), "\n"; + } catch (ValueError $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -54,8 +54,8 @@ is_file($tempfile) and @unlink($tempfile); isset($tempname) and is_file($tempname) and @unlink($tempname); ?> --EXPECT-- -curl_setopt(): The file handle provided for CURLOPT_FILE must be writable -curl_setopt(): The file handle provided for CURLOPT_WRITEHEADER must be writable -curl_setopt(): The file handle provided for CURLOPT_STDERR must be writable +ValueError: curl_setopt(): The file handle provided for CURLOPT_FILE must be writable +ValueError: curl_setopt(): The file handle provided for CURLOPT_WRITEHEADER must be writable +ValueError: curl_setopt(): The file handle provided for CURLOPT_STDERR must be writable Hello World! Hello World! diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt index c175df5248fe..624953aa2ea9 100644 --- a/ext/curl/tests/bug68089.phpt +++ b/ext/curl/tests/bug68089.phpt @@ -9,12 +9,12 @@ $ch = curl_init(); try { curl_setopt($ch, CURLOPT_URL, $url); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (ValueError $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> Done --EXPECT-- -curl_setopt(): cURL option CURLOPT_URL must not contain any null bytes +ValueError: curl_setopt(): cURL option CURLOPT_URL must not contain any null bytes Done