Commit db16b0fa052 for php.net

commit db16b0fa052f536b29d1a5f5c52a8572962080c4
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Fri Aug 14 16:20:05 2026 +0700

    ext/soap: applied fixers to improve test robustness (#23031)

diff --git a/ext/soap/tests/bugs/bug31755.phpt b/ext/soap/tests/bugs/bug31755.phpt
index c4b2c622b6a..2cd623888b5 100644
--- a/ext/soap/tests/bugs/bug31755.phpt
+++ b/ext/soap/tests/bugs/bug31755.phpt
@@ -17,7 +17,7 @@ public function __doRequest($request, $location, $action, $version, $one_way = f
 try {
     new SOAPHeader('', 'foo', 'bar');
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $header = new SOAPHeader('namespace', 'foo', 'bar');
@@ -26,6 +26,6 @@ public function __doRequest($request, $location, $action, $version, $one_way = f
 print $client->__getLastRequest();
 ?>
 --EXPECT--
-SoapHeader::__construct(): Argument #1 ($namespace) must not be empty
+ValueError: SoapHeader::__construct(): Argument #1 ($namespace) must not be empty
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myNS" xmlns:ns2="namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns2:foo>bar</ns2:foo></SOAP-ENV:Header><SOAP-ENV:Body><ns1:function/></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt
index 2f9c1830ad3..ef8f744b137 100644
--- a/ext/soap/tests/bugs/bug42151.phpt
+++ b/ext/soap/tests/bugs/bug42151.phpt
@@ -21,12 +21,12 @@ function __destruct(){
     $bar = new bar();
     $foo = new foo();
 } catch (Exception $e){
-    echo $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "ok\n";
 ?>
 --EXPECTF--
-SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s
+SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s

 ok
 I don't get executed either.
diff --git a/ext/soap/tests/bugs/bug42692.phpt b/ext/soap/tests/bugs/bug42692.phpt
index fe4840d9268..78126325ad5 100644
--- a/ext/soap/tests/bugs/bug42692.phpt
+++ b/ext/soap/tests/bugs/bug42692.phpt
@@ -33,7 +33,7 @@ function __doRequest($request, $location, $action, $version, $one_way = false, ?
     $result = $client->checkAuth(1,"two");
     echo "Auth for 1 is $result\n";
 } catch (Exception $e) {
-    echo $e->getMessage();
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }
 ?>
 --EXPECT--
diff --git a/ext/soap/tests/bugs/bug55639.phpt b/ext/soap/tests/bugs/bug55639.phpt
index 16d7f7a3771..83438936198 100644
--- a/ext/soap/tests/bugs/bug55639.phpt
+++ b/ext/soap/tests/bugs/bug55639.phpt
@@ -44,7 +44,7 @@
 try {
     $client->__soapCall("foo", []);
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $headers = $client->__getLastRequestHeaders();
@@ -52,7 +52,7 @@

 ?>
 --EXPECTF--
-Unauthorized
+SoapFault: Unauthorized
 string(%d) "POST / HTTP/1.1
 Host: %s
 Connection: Keep-Alive
diff --git a/ext/soap/tests/bugs/bug71610.phpt b/ext/soap/tests/bugs/bug71610.phpt
index f7f674fa059..34709c5b069 100644
--- a/ext/soap/tests/bugs/bug71610.phpt
+++ b/ext/soap/tests/bugs/bug71610.phpt
@@ -21,8 +21,8 @@
 try {
 $exploit->blahblah();
 } catch(SoapFault $e) {
-    echo $e->getMessage()."\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-looks like we got no XML document
+SoapFault: looks like we got no XML document
diff --git a/ext/soap/tests/bugs/bug73037.phpt b/ext/soap/tests/bugs/bug73037.phpt
index 7a5b9977677..6d94fca04e0 100644
--- a/ext/soap/tests/bugs/bug73037.phpt
+++ b/ext/soap/tests/bugs/bug73037.phpt
@@ -175,4 +175,3 @@ function get_data($max)
 Function 'CATALOG' doesn't exist

 Function 'CATALOG' doesn't exist
-
diff --git a/ext/soap/tests/bugs/bug80672.phpt b/ext/soap/tests/bugs/bug80672.phpt
index 2abc40e3913..d5f54ef6b80 100644
--- a/ext/soap/tests/bugs/bug80672.phpt
+++ b/ext/soap/tests/bugs/bug80672.phpt
@@ -8,8 +8,8 @@
     $client = new SoapClient(__DIR__ . "/bug80672.xml");
     $query = $soap->query(array('sXML' => 'something'));
 } catch(SoapFault $e) {
-    print $e->getMessage();
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }
 ?>
 --EXPECT--
-SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <>
+SoapFault: SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <>
diff --git a/ext/soap/tests/bugs/gh16237.phpt b/ext/soap/tests/bugs/gh16237.phpt
index 468f2794399..c86e9c14039 100644
--- a/ext/soap/tests/bugs/gh16237.phpt
+++ b/ext/soap/tests/bugs/gh16237.phpt
@@ -9,9 +9,9 @@
 try {
     clone $server;
 } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Trying to clone an uncloneable object of class SoapServer
+Error: Trying to clone an uncloneable object of class SoapServer
diff --git a/ext/soap/tests/bugs/gh16256.phpt b/ext/soap/tests/bugs/gh16256.phpt
index a6d5f3fbbf3..cefc05c4dd0 100644
--- a/ext/soap/tests/bugs/gh16256.phpt
+++ b/ext/soap/tests/bugs/gh16256.phpt
@@ -11,14 +11,14 @@
 try {
     new SoapClient($wsdl, ["classmap" => $classmap]);
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     new SoapServer($wsdl, ["classmap" => $classmap]);
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-SoapClient::__construct(): Argument #2 ($options) "classmap" option must be an associative array
-SoapServer::__construct(): Argument #2 ($options) "classmap" option must be an associative array
+ValueError: SoapClient::__construct(): Argument #2 ($options) "classmap" option must be an associative array
+ValueError: SoapServer::__construct(): Argument #2 ($options) "classmap" option must be an associative array
diff --git a/ext/soap/tests/bugs/gh16429.phpt b/ext/soap/tests/bugs/gh16429.phpt
index 24d517f96b9..b7073a05b23 100644
--- a/ext/soap/tests/bugs/gh16429.phpt
+++ b/ext/soap/tests/bugs/gh16429.phpt
@@ -14,9 +14,9 @@ function gen() {
 try {
     $client->echo2DStringArray($fusion);
 } catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 string(10) "xxxxxxxxxx"
-Cannot traverse an already closed generator
+Exception: Cannot traverse an already closed generator
diff --git a/ext/soap/tests/bugs/gh22167.phpt b/ext/soap/tests/bugs/gh22167.phpt
index f24bfb0eac3..9a6518d2ad7 100644
--- a/ext/soap/tests/bugs/gh22167.phpt
+++ b/ext/soap/tests/bugs/gh22167.phpt
@@ -98,31 +98,31 @@ function restriction_schema(string $facet, string $value = "2147483648"): string
         new SoapClient($file, ["cache_wsdl" => WSDL_CACHE_NONE]);
         echo "$name: parsed\n";
     } catch (SoapFault $e) {
-        echo "$name: {$e->getMessage()}\n";
+        echo "$name: ", $e::class, ': ', $e->getMessage(), "\n";
     } finally {
         unlink($file);
     }
 }
 ?>
 --EXPECT--
-minOccurs: SOAP-ERROR: Parsing Schema: minOccurs value is out of range
-maxOccurs: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-negative minOccurs: SOAP-ERROR: Parsing Schema: minOccurs value is out of range
-negative maxOccurs: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-minExclusive: SOAP-ERROR: Parsing Schema: minExclusive value is out of range
-minInclusive: SOAP-ERROR: Parsing Schema: minInclusive value is out of range
-maxExclusive: SOAP-ERROR: Parsing Schema: maxExclusive value is out of range
-maxInclusive: SOAP-ERROR: Parsing Schema: maxInclusive value is out of range
-totalDigits: SOAP-ERROR: Parsing Schema: totalDigits value is out of range
-fractionDigits: SOAP-ERROR: Parsing Schema: fractionDigits value is out of range
-length: SOAP-ERROR: Parsing Schema: length value is out of range
-minLength: SOAP-ERROR: Parsing Schema: minLength value is out of range
-maxLength: SOAP-ERROR: Parsing Schema: maxLength value is out of range
-leading whitespace numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-leading plus numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-leading zero numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-leading numeric-string with trailing data: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-negative out-of-range numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-decimal numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
-exponent numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+minOccurs: SoapFault: SOAP-ERROR: Parsing Schema: minOccurs value is out of range
+maxOccurs: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+negative minOccurs: SoapFault: SOAP-ERROR: Parsing Schema: minOccurs value is out of range
+negative maxOccurs: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+minExclusive: SoapFault: SOAP-ERROR: Parsing Schema: minExclusive value is out of range
+minInclusive: SoapFault: SOAP-ERROR: Parsing Schema: minInclusive value is out of range
+maxExclusive: SoapFault: SOAP-ERROR: Parsing Schema: maxExclusive value is out of range
+maxInclusive: SoapFault: SOAP-ERROR: Parsing Schema: maxInclusive value is out of range
+totalDigits: SoapFault: SOAP-ERROR: Parsing Schema: totalDigits value is out of range
+fractionDigits: SoapFault: SOAP-ERROR: Parsing Schema: fractionDigits value is out of range
+length: SoapFault: SOAP-ERROR: Parsing Schema: length value is out of range
+minLength: SoapFault: SOAP-ERROR: Parsing Schema: minLength value is out of range
+maxLength: SoapFault: SOAP-ERROR: Parsing Schema: maxLength value is out of range
+leading whitespace numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+leading plus numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+leading zero numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+leading numeric-string with trailing data: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+negative out-of-range numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+decimal numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
+exponent numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range
 fractional numeric-string within int range: parsed
diff --git a/ext/soap/tests/bugs/protocol_relative_redirect.phpt b/ext/soap/tests/bugs/protocol_relative_redirect.phpt
index e8f30ca6687..e9c30f0ab29 100644
--- a/ext/soap/tests/bugs/protocol_relative_redirect.phpt
+++ b/ext/soap/tests/bugs/protocol_relative_redirect.phpt
@@ -42,7 +42,7 @@
     $client->__soapCall("foo", []);
     echo "redirect followed\n";
 } catch (SoapFault $e) {
-    echo "SoapFault: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
diff --git a/ext/soap/tests/bugs/relative_redirect.phpt b/ext/soap/tests/bugs/relative_redirect.phpt
index 774e7cbd98d..ebdcd97e5d4 100644
--- a/ext/soap/tests/bugs/relative_redirect.phpt
+++ b/ext/soap/tests/bugs/relative_redirect.phpt
@@ -42,7 +42,7 @@
     $client->__soapCall("foo", []);
     echo "redirect followed\n";
 } catch (SoapFault $e) {
-    echo "SoapFault: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
diff --git a/ext/soap/tests/bugs/relative_redirect_path.phpt b/ext/soap/tests/bugs/relative_redirect_path.phpt
index 09d4c857cc9..2e18c12b926 100644
--- a/ext/soap/tests/bugs/relative_redirect_path.phpt
+++ b/ext/soap/tests/bugs/relative_redirect_path.phpt
@@ -42,7 +42,7 @@
     $client->__soapCall("foo", []);
     echo "redirect followed\n";
 } catch (SoapFault $e) {
-    echo "SoapFault: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
diff --git a/ext/soap/tests/fault_warning.phpt b/ext/soap/tests/fault_warning.phpt
index 2a9d99fb5db..d8c2921a8ef 100644
--- a/ext/soap/tests/fault_warning.phpt
+++ b/ext/soap/tests/fault_warning.phpt
@@ -8,13 +8,13 @@
 try {
     new SoapFault("", "message"); // Can't be an empty string
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     new SoapFault(new stdClass(), "message");  // Can't be a non-string (except for null)
 } catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $fault = new SoapFault("Sender", "message");
@@ -25,13 +25,13 @@
 try {
     new SoapFault(["more"], "message");  // two elements in array required
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     new SoapFault(["m", "more", "superfluous"], "message"); // two required
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $fault = new SoapFault(["more-ns", "Sender"], "message");  // two given
@@ -39,10 +39,10 @@

 ?>
 --EXPECT--
-SoapFault::__construct(): Argument #1 ($code) is not a valid fault code
-SoapFault::__construct(): Argument #1 ($code) must be of type array|string|null, stdClass given
+ValueError: SoapFault::__construct(): Argument #1 ($code) is not a valid fault code
+TypeError: SoapFault::__construct(): Argument #1 ($code) must be of type array|string|null, stdClass given
 SoapFault
 SoapFault
-SoapFault::__construct(): Argument #1 ($code) is not a valid fault code
-SoapFault::__construct(): Argument #1 ($code) is not a valid fault code
+ValueError: SoapFault::__construct(): Argument #1 ($code) is not a valid fault code
+ValueError: SoapFault::__construct(): Argument #1 ($code) is not a valid fault code
 SoapFault
diff --git a/ext/soap/tests/gh15711.phpt b/ext/soap/tests/gh15711.phpt
index 17ff051698f..d3c04d319ab 100644
--- a/ext/soap/tests/gh15711.phpt
+++ b/ext/soap/tests/gh15711.phpt
@@ -64,7 +64,7 @@ function __doRequest($request, $location, $action, $version, $one_way = false, ?
 try {
     $client->dotest($book);
 } catch (ValueError $e) {
-    echo "ValueError: ", $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "--- Test with mismatched enum backing type ---\n";
@@ -74,7 +74,7 @@ function __doRequest($request, $location, $action, $version, $one_way = false, ?
 try {
     $client->dotest($book);
 } catch (ValueError $e) {
-    echo "ValueError: ", $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/ext/soap/tests/gh16318.phpt b/ext/soap/tests/gh16318.phpt
index 0c38b6fc8de..ce0490d9592 100644
--- a/ext/soap/tests/gh16318.phpt
+++ b/ext/soap/tests/gh16318.phpt
@@ -26,11 +26,11 @@ public function __doRequest(string $request, string $location, string $action, i
     try {
         $client->__soapCall("echoStructArray", array($test), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
     } catch (ValueError $e) {
-        echo $e->getMessage(), "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 ?>
 --EXPECT--
-Recursive array cannot be encoded
-Recursive array cannot be encoded
+ValueError: Recursive array cannot be encoded
+ValueError: Recursive array cannot be encoded