File: bug42736.phpt

package info (click to toggle)
php-xmlrpc 3%3A1.0.0~rc3-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 648 kB
  • sloc: ansic: 5,180; xml: 153; php: 17; makefile: 3
file content (56 lines) | stat: -rw-r--r-- 1,240 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--TEST--
Bug #42736 (xmlrpc_server_call_method() crashes)
--SKIPIF--
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
--FILE--
<?php

class SOAP_Array {
    public function get($id){
        return $this->add($id);
    }
}

$xml = xmlrpc_server_create();

$Myrequest = '<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>GetProducts</methodName><params><param><value><dateTime.iso8601>20060922T14:26:19</dateTime.iso8601></value></param></params></methodCall>';

class MyClass {
    function GetProducts($dummy, $time){
        return array('faultString' => $time);
    }
}
$myclass =  new MyClass();
xmlrpc_server_register_method($xml, 'GetProducts', array($myclass, 'GetProducts'));
$response = xmlrpc_server_call_method($xml, $Myrequest, null);

var_dump($response);

echo "Done\n";
?>
--EXPECT--
string(402) "<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<params>
 <param>
  <value>
   <struct>
    <member>
     <name>faultString</name>
     <value>
      <array>
       <data>
        <value>
         <dateTime.iso8601>20060922T14:26:19</dateTime.iso8601>
        </value>
       </data>
      </array>
     </value>
    </member>
   </struct>
  </value>
 </param>
</params>
</methodResponse>
"
Done