| 1 |
lars |
1 |
--TEST--
|
|
|
2 |
XMLRPCext Backend XML-RPC server with normal response (with prefix in phpdoc)
|
|
|
3 |
--SKIPIF--
|
|
|
4 |
<?php
|
|
|
5 |
if (!function_exists('xmlrpc_server_create')) {
|
|
|
6 |
print "Skip XMLRPC extension unavailable";
|
|
|
7 |
}
|
|
|
8 |
?>
|
|
|
9 |
--FILE--
|
|
|
10 |
<?php
|
|
|
11 |
class EchoServer {
|
|
|
12 |
/**
|
|
|
13 |
* echoecho echoes the message received
|
|
|
14 |
*
|
|
|
15 |
* @param string Message
|
|
|
16 |
* @xmlrpc.prefix prefixed.
|
|
|
17 |
* @return string The echo
|
|
|
18 |
*/
|
|
|
19 |
public static function echoecho($string) {
|
|
|
20 |
return $string;
|
|
|
21 |
}
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
set_include_path(realpath(dirname(__FILE__) . '/../../../../') . PATH_SEPARATOR . get_include_path());
|
|
|
25 |
require_once 'XML/RPC2/Backend.php';
|
|
|
26 |
require_once 'XML/RPC2/Server.php';
|
|
|
27 |
require_once 'XML/RPC2/Backend/Php/Response.php';
|
|
|
28 |
XML_RPC2_Backend::setBackend('XMLRPCext');
|
|
|
29 |
$server = XML_RPC2_Server::create('EchoServer');
|
|
|
30 |
$GLOBALS['HTTP_RAW_POST_DATA'] = <<<EOS
|
|
|
31 |
<?xml version="1.0"?>
|
|
|
32 |
<methodCall>
|
|
|
33 |
<methodName>prefixed.echoecho</methodName>
|
|
|
34 |
<params><param><value><string>World</string></value></param></params>
|
|
|
35 |
</methodCall>
|
|
|
36 |
EOS
|
|
|
37 |
;
|
|
|
38 |
$response = $server->getResponse();
|
|
|
39 |
var_dump(XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response)));
|
|
|
40 |
?>
|
|
|
41 |
--EXPECT--
|
|
|
42 |
string(5) "World"
|