From a67475344382c393b4a329438304cc6ee4bdff81 Mon Sep 17 00:00:00 2001 From: gggeek Date: Mon, 30 Jan 2023 17:12:14 +0000 Subject: [PATCH] undeprecate setDebug; fix one interop error; add a test for interop errors --- src/Client.php | 1 - src/Helper/Interop.php | 2 +- src/Server.php | 1 - tests/07ClientTest.php | 12 ++++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index 9c879e63..e1230fd6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -629,7 +629,6 @@ class Client * * @param integer $level values -1, 0, 1 and 2 are supported * @return $this - * @deprecated use setOption */ public function setDebug($level) { diff --git a/src/Helper/Interop.php b/src/Helper/Interop.php index e37270c9..9311576f 100644 --- a/src/Helper/Interop.php +++ b/src/Helper/Interop.php @@ -13,7 +13,7 @@ class Interop 'invalid_return' => 2, 'incorrect_params' => -32602, 'introspect_unknown' => -32601, // this shares the same code but has a separate meaning from 'unknown_method'... - 'http_error' => 32300, + 'http_error' => -32300, 'no_data' => -32700, 'no_ssl' => -32400, 'curl_fail' => -32400, diff --git a/src/Server.php b/src/Server.php index 2c9378ac..a9f35fa2 100644 --- a/src/Server.php +++ b/src/Server.php @@ -294,7 +294,6 @@ class Server * execution anymore, but just end up logged in the xml-rpc response) * Note that info added at level 2 and 3 will be base64 encoded * @return $this - * @deprecated use setOption */ public function setDebug($level) { diff --git a/tests/07ClientTest.php b/tests/07ClientTest.php index fe020068..07a6abdc 100644 --- a/tests/07ClientTest.php +++ b/tests/07ClientTest.php @@ -27,6 +27,18 @@ class ClientTest extends PhpXmlRpc_LoggerAwareTestCase $this->assertEquals(5, $r->faultCode()); } + public function test404Interop() + { + $m = new xmlrpcmsg('examples.echo', array( + new xmlrpcval('hello', 'string'), + )); + $orig = \PhpXmlRpc\PhpXmlRpc::$xmlrpcerr; + \PhpXmlRpc\PhpXmlRpc::useInteropFaults(); + $r = $this->client->send($m, 5); + $this->assertEquals(-32300, $r->faultCode()); + \PhpXmlRpc\PhpXmlRpc::$xmlrpcerr = $orig; + } + public function testSrvNotFound() { $m = new xmlrpcmsg('examples.echo', array( -- 2.47.0