xref: /PHP-7.1/ext/xmlrpc/tests/001.phpt (revision 7af945e2)
1--TEST--
2xmlrpc_encode_request() with wrong arguments
3--SKIPIF--
4<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(xmlrpc_encode_request(-1, 1));
9var_dump(xmlrpc_encode_request("", 1));
10var_dump(xmlrpc_encode_request(array(), 1));
11var_dump(xmlrpc_encode_request(3.4, 1));
12
13echo "Done\n";
14?>
15--EXPECTF--
16string(174) "<?xml version="1.0" encoding="iso-8859-1"?>
17<methodCall>
18<methodName>-1</methodName>
19<params>
20 <param>
21  <value>
22   <int>1</int>
23  </value>
24 </param>
25</params>
26</methodCall>
27"
28string(160) "<?xml version="1.0" encoding="iso-8859-1"?>
29<methodCall>
30<methodName/>
31<params>
32 <param>
33  <value>
34   <int>1</int>
35  </value>
36 </param>
37</params>
38</methodCall>
39"
40
41Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d
42NULL
43string(175) "<?xml version="1.0" encoding="iso-8859-1"?>
44<methodCall>
45<methodName>3.4</methodName>
46<params>
47 <param>
48  <value>
49   <int>1</int>
50  </value>
51 </param>
52</params>
53</methodCall>
54"
55Done
56