aboutsummaryrefslogblamecommitdiffstats
path: root/tests/unit/XmlRpcTest.php
blob: c245917dc103937c4bb2fd795560533a8cbefe8a (plain) (tree)

























                                                                                       
<?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);
    }
}