Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

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