diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-07-06 11:12:53 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2024-07-06 11:42:08 +0200 |
commit | f6132cac7e534d26ae3189b09f55be3a06aa7beb (patch) | |
tree | 0307aa8a9f5d64af77a8fffec7994bcde6b6efc3 /tests | |
parent | b98c9ee7fa567785ba442841c233526f53ff546e (diff) | |
download | volse-webtrap-f6132cac7e534d26ae3189b09f55be3a06aa7beb.tar.gz volse-webtrap-f6132cac7e534d26ae3189b09f55be3a06aa7beb.tar.bz2 volse-webtrap-f6132cac7e534d26ae3189b09f55be3a06aa7beb.zip |
Add class for representing XML-RPC payloads.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/XmlRpcTest.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/XmlRpcTest.php b/tests/unit/XmlRpcTest.php new file mode 100644 index 0000000..c245917 --- /dev/null +++ b/tests/unit/XmlRpcTest.php @@ -0,0 +1,26 @@ +<?php + +// SPDX-FileCopyrightText: 2024 Eilertsens Kodeknekkeri +// SPDX-FileCopyrightText: 2024 Harald Eilertsen +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +namespace VolseNet\Webtrap\Tests\Unit; + +use PHPUnit\Framework\TestCase; +use VolseNet\Webtrap\XmlRpcMethod; + +class XmlRpcTest extends TestCase +{ + public function testGetUserBlog(): void + { + $payload = '<methodCall><methodName>wp.getUsersBlogs</methodName>' + . '<params><param><value>someuser</value></param>' + . '<param><value>verysecretpassword</value></param></params></methodCall>'; + + $method = XmlRpcMethod::parse($payload); + + $this->assertEquals('wp.getUsersBlogs', $method->name); + $this->assertEquals(['someuser', 'verysecretpassword'], $method->params); + } +} |