Skip to content

Commit a89e713

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Test extension xmlrpc encode type double and string decode type string and int
2 parents 286c745 + e22c139 commit a89e713

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

ext/xmlrpc/tests/005.phpt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--TEST--
2+
xmlrpc_encode() Simple test encode type double and String
3+
4+
--CREDITS--
5+
Michel Araujo <araujo_michel@yahoo.com.br>
6+
#PHPSP 2013-08-22
7+
8+
--SKIPIF--
9+
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
10+
11+
--FILE--
12+
<?php
13+
14+
$response = xmlrpc_encode(3.24234);
15+
echo $response;
16+
17+
$response = xmlrpc_encode(-3.24234);
18+
echo $response;
19+
20+
$response = xmlrpc_encode('Is string');
21+
echo $response;
22+
23+
--EXPECT--
24+
<?xml version="1.0" encoding="utf-8"?>
25+
<params>
26+
<param>
27+
<value>
28+
<double>3.24234</double>
29+
</value>
30+
</param>
31+
</params>
32+
<?xml version="1.0" encoding="utf-8"?>
33+
<params>
34+
<param>
35+
<value>
36+
<double>-3.24234</double>
37+
</value>
38+
</param>
39+
</params>
40+
<?xml version="1.0" encoding="utf-8"?>
41+
<params>
42+
<param>
43+
<value>
44+
<string>Is string</string>
45+
</value>
46+
</param>
47+
</params>

ext/xmlrpc/tests/006.phpt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
xmlrpc_decode() Simple test decode type string
3+
4+
--CREDITS--
5+
Michel Araujo <araujo_michel@yahoo.com.br>
6+
#PHPSP 2013-08-22
7+
8+
--SKIPIF--
9+
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
10+
11+
--FILE--
12+
<?php
13+
14+
$xml = <<<XML
15+
<?xml version="1.0" encoding="utf-8"?>
16+
<params>
17+
<param>
18+
<value>
19+
<string>Is string</string>
20+
</value>
21+
</param>
22+
</params>
23+
XML;
24+
25+
$response = xmlrpc_decode($xml);
26+
echo $response;
27+
28+
--EXPECT--
29+
Is string

ext/xmlrpc/tests/007.phpt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
xmlrpc_decode() Simple test decode type int
3+
4+
--CREDITS--
5+
Michel Araujo <araujo_michel@yahoo.com.br>
6+
#PHPSP 2013-08-22
7+
8+
--SKIPIF--
9+
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
10+
11+
--FILE--
12+
<?php
13+
14+
$xml = <<<XML
15+
<?xml version="1.0" encoding="utf-8"?>
16+
<params>
17+
<param>
18+
<value>
19+
<int>1</int>
20+
</value>
21+
</param>
22+
</params>
23+
XML;
24+
25+
$response = xmlrpc_decode($xml);
26+
echo $response;
27+
28+
--EXPECT--
29+
1

0 commit comments

Comments
 (0)