Skip to content

Commit 36e7dde

Browse files
committed
Add test for XML_RPC_Response, when valid
1 parent 5cbcf98 commit 36e7dde

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/include/bundledLibsTest.php

+30
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,34 @@ public function test_serendipity_xml_rpc_message()
4444
$this->assertEquals($expected, $message->payload);
4545
}
4646

47+
#[Test]
48+
public function test_serendipity_xml_rpc_response_valid()
49+
{
50+
$args = array(
51+
new XML_RPC_Value(
52+
'testA',
53+
'string'
54+
),
55+
new XML_RPC_Value(
56+
'testB',
57+
'string'
58+
)
59+
);
60+
$message = new XML_RPC_Message(
61+
'weblogUpdates.ping',
62+
$args
63+
);
64+
$message->createPayload();
65+
$example_response = "<methodResponse>
66+
<params>
67+
<param>
68+
<value><string>Success!</string></value>
69+
</param>
70+
</params>
71+
</methodResponse>";
72+
73+
$xmlrpc_result = $message->parseResponse($example_response);
74+
$this->assertEquals($example_response, $xmlrpc_result->serialize());
75+
}
76+
4777
}

0 commit comments

Comments
 (0)