File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / xmlrpc / tests / bug42736.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:05 2012 UTC (12 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--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";
?>
--EXPECTF--	
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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>