Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
XMLRPCext Backend XML-RPC server with normal response
3
--SKIPIF--
4
<?php
5
// I can't silence expat errors anyhow. We're skipping this test
6
// for xmlrpci
7
print "skip";
8
--FILE--
9
<?php
10
class EchoServer {
11
    /**
12
     * echoecho echoes the message received
13
     *
14
     * @param string  Message
15
     * @return string The echo
16
     */
17
    public static function echoecho($string) {
18
        return $string;
19
    }
20
}
21
 
22
set_include_path(realpath(dirname(__FILE__) . '/../../../../') . PATH_SEPARATOR . get_include_path());
23
require_once 'XML/RPC2/Backend.php';
24
require_once 'XML/RPC2/Server.php';
25
require_once 'XML/RPC2/Backend/Php/Response.php';
26
XML_RPC2_Backend::setBackend('XMLRPCext');
27
$server = XML_RPC2_Server::create('EchoServer');
28
$GLOBALS['HTTP_RAW_POST_DATA'] = <<<EOS
29
<?xml version="1.0"?>
30
<methodCall>
31
 <methodName>moo</methodName>
32
 <params><param><value><string>World</string></value></param></prams>
33
</methodCall>
34
EOS
35
;
36
try {
37
    $response = $server->getResponse();
38
    //print($response);
39
    //XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response));
40
} catch (XML_RPC2_FaultException $e) {
41
    var_dump($e->getMessage());
42
}
43
?>
44
--EXPECT--
45
string(36) "server error. method not found.
46
 
47
moo"