From f6132cac7e534d26ae3189b09f55be3a06aa7beb Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 6 Jul 2024 11:12:53 +0200 Subject: Add class for representing XML-RPC payloads. --- src/XmlRpcMethod.php | 75 +++++++++++++++++++++++++++++++++++++++++++++++ tests/unit/XmlRpcTest.php | 26 ++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 src/XmlRpcMethod.php create mode 100644 tests/unit/XmlRpcTest.php diff --git a/src/XmlRpcMethod.php b/src/XmlRpcMethod.php new file mode 100644 index 0000000..2167e53 --- /dev/null +++ b/src/XmlRpcMethod.php @@ -0,0 +1,75 @@ +wp.getUsersBlogs' + . 'someuser' + . 'verysecretpassword'; + + $method = XmlRpcMethod::parse($payload); + + $this->assertEquals('wp.getUsersBlogs', $method->name); + $this->assertEquals(['someuser', 'verysecretpassword'], $method->params); + } +} -- cgit v1.2.3