xref: /PHP-7.2/ext/xmlrpc/tests/002.phpt (revision 17ccbeec)
1--TEST--
2xmlrpc_encode_request() and various arguments
3--SKIPIF--
4<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
5--FILE--
6<?php
7
8$r = xmlrpc_encode_request("method", array());
9var_dump(xmlrpc_decode_request($r, $method));
10var_dump($method);
11
12$r = xmlrpc_encode_request("method", 1);
13var_dump(xmlrpc_decode_request($r, $method));
14var_dump($method);
15
16$r = xmlrpc_encode_request("method", 'param');
17var_dump(xmlrpc_decode_request($r, $method));
18var_dump($method);
19
20$r = xmlrpc_encode_request(-1, "");
21var_dump(xmlrpc_decode_request($r, $method));
22var_dump($method);
23
24$r = xmlrpc_encode_request(array(), 1);
25var_dump(xmlrpc_decode_request($r, $method));
26var_dump($method);
27
28echo "Done\n";
29?>
30--EXPECTF--
31array(0) {
32}
33string(6) "method"
34array(1) {
35  [0]=>
36  int(1)
37}
38string(6) "method"
39array(1) {
40  [0]=>
41  string(5) "param"
42}
43string(6) "method"
44array(1) {
45  [0]=>
46  string(0) ""
47}
48string(2) "-1"
49
50Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d
51NULL
52string(2) "-1"
53Done
54