xref: /PHP-5.4/ext/xmlrpc/tests/bug50761.phpt (revision f38bfa62)
1--TEST--
2Bug #50761 (system.multiCall crashes)
3--SKIPIF--
4<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
5--FILE--
6<?php
7$req = '<?xml version="1.0"?>
8<methodCall>
9<methodName>system.multiCall</methodName>
10<params><param><value><array><data>
11<value><struct>
12<member><name>methodName</name><value><string>testMethodA</string></value></member>
13<member><name>params</name><value><array><data><value><string>A</string>
14</value></data></array></value></member>
15</struct></value>
16<value><struct>
17<member><name>methodName</name><value><string>testMethodB</string></value></member>
18<member><name>params</name><value><array><data><value><string>B</string>
19</value></data></array></value></member>
20</struct></value>
21</data></array></value></param></params>
22</methodCall>';
23
24function testA($methodName, $params, $var){ return "C"; }
25function testB($methodName, $params, $var){ return "D"; }
26
27$server = xmlrpc_server_create();
28xmlrpc_server_register_method($server, 'testMethodA', 'testA');
29xmlrpc_server_register_method($server, 'testMethodB', 'testB');
30$res = xmlrpc_server_call_method($server, $req, null);
31echo $res;
32?>
33--EXPECT--
34<?xml version="1.0" encoding="iso-8859-1"?>
35<methodResponse>
36<params>
37 <param>
38  <value>
39   <array>
40    <data>
41     <value>
42      <array>
43       <data>
44        <value>
45         <string>C</string>
46        </value>
47       </data>
48      </array>
49     </value>
50     <value>
51      <array>
52       <data>
53        <value>
54         <string>D</string>
55        </value>
56       </data>
57      </array>
58     </value>
59    </data>
60   </array>
61  </value>
62 </param>
63</params>
64</methodResponse>
65