diff options
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); + } +} |