diff options
author | Ondřej Surý <ondrej@sury.org> | 2013-09-27 11:27:58 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2013-09-27 11:27:58 +0200 |
commit | 1fd24dd3e14010b82febd3e300599f8d8f9c592c (patch) | |
tree | 60d089e947831184a569c1db6c23e45e18d46723 /ext/xmlrpc | |
parent | 9989e8bb3d7b37e3b3b351feece5ed4346174ccf (diff) | |
download | php-1fd24dd3e14010b82febd3e300599f8d8f9c592c.tar.gz |
New upstream version 5.5.4+dfsgupstream/5.5.4+dfsg
Diffstat (limited to 'ext/xmlrpc')
-rw-r--r-- | ext/xmlrpc/tests/003.phpt | 109 | ||||
-rw-r--r-- | ext/xmlrpc/tests/004.phpt | 19 | ||||
-rw-r--r-- | ext/xmlrpc/tests/005.phpt | 47 | ||||
-rw-r--r-- | ext/xmlrpc/tests/006.phpt | 29 | ||||
-rw-r--r-- | ext/xmlrpc/tests/007.phpt | 29 |
5 files changed, 233 insertions, 0 deletions
diff --git a/ext/xmlrpc/tests/003.phpt b/ext/xmlrpc/tests/003.phpt new file mode 100644 index 000000000..3d6796dba --- /dev/null +++ b/ext/xmlrpc/tests/003.phpt @@ -0,0 +1,109 @@ +--TEST-- +xmlrpc_encode() Simple test encode array +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> +--FILE-- +<?php + +$params = array( + "one" => "red", + "two" => "blue", + "three" => "green" +); + +$response = xmlrpc_encode($params); +echo $response; + +$params = array( + "red", + "blue", + "green" +); + +$response = xmlrpc_encode($params); +echo $response; + +$params = array( + 0 => "red", + 1 => "blue", + 3 => "green" +); + +$response = xmlrpc_encode($params); +echo $response; + +--EXPECT-- +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <struct> + <member> + <name>one</name> + <value> + <string>red</string> + </value> + </member> + <member> + <name>two</name> + <value> + <string>blue</string> + </value> + </member> + <member> + <name>three</name> + <value> + <string>green</string> + </value> + </member> + </struct> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <array> + <data> + <value> + <string>red</string> + </value> + <value> + <string>blue</string> + </value> + <value> + <string>green</string> + </value> + </data> + </array> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <struct> + <member> + <name>0</name> + <value> + <string>red</string> + </value> + </member> + <member> + <name>1</name> + <value> + <string>blue</string> + </value> + </member> + <member> + <name>3</name> + <value> + <string>green</string> + </value> + </member> + </struct> + </value> +</param> +</params>
\ No newline at end of file diff --git a/ext/xmlrpc/tests/004.phpt b/ext/xmlrpc/tests/004.phpt new file mode 100644 index 000000000..04f3ef315 --- /dev/null +++ b/ext/xmlrpc/tests/004.phpt @@ -0,0 +1,19 @@ +--TEST-- +xmlrpc_encode() Simple test encode int +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> +--FILE-- +<?php + +$response = xmlrpc_encode(1); +echo $response; + +--EXPECT-- +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <int>1</int> + </value> +</param> +</params>
\ No newline at end of file diff --git a/ext/xmlrpc/tests/005.phpt b/ext/xmlrpc/tests/005.phpt new file mode 100644 index 000000000..613dfde24 --- /dev/null +++ b/ext/xmlrpc/tests/005.phpt @@ -0,0 +1,47 @@ +--TEST-- +xmlrpc_encode() Simple test encode type double and String + +--CREDITS-- +Michel Araujo <araujo_michel@yahoo.com.br> +#PHPSP 2013-08-22 + +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> + +--FILE-- +<?php + +$response = xmlrpc_encode(3.24234); +echo $response; + +$response = xmlrpc_encode(-3.24234); +echo $response; + +$response = xmlrpc_encode('Is string'); +echo $response; + +--EXPECT-- +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <double>3.24234</double> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <double>-3.24234</double> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <string>Is string</string> + </value> +</param> +</params>
\ No newline at end of file diff --git a/ext/xmlrpc/tests/006.phpt b/ext/xmlrpc/tests/006.phpt new file mode 100644 index 000000000..f33932d5a --- /dev/null +++ b/ext/xmlrpc/tests/006.phpt @@ -0,0 +1,29 @@ +--TEST-- +xmlrpc_decode() Simple test decode type string + +--CREDITS-- +Michel Araujo <araujo_michel@yahoo.com.br> +#PHPSP 2013-08-22 + +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> + +--FILE-- +<?php + +$xml = <<<XML +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <string>Is string</string> + </value> +</param> +</params> +XML; + +$response = xmlrpc_decode($xml); +echo $response; + +--EXPECT-- +Is string
\ No newline at end of file diff --git a/ext/xmlrpc/tests/007.phpt b/ext/xmlrpc/tests/007.phpt new file mode 100644 index 000000000..84c15a7d8 --- /dev/null +++ b/ext/xmlrpc/tests/007.phpt @@ -0,0 +1,29 @@ +--TEST-- +xmlrpc_decode() Simple test decode type int + +--CREDITS-- +Michel Araujo <araujo_michel@yahoo.com.br> +#PHPSP 2013-08-22 + +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> + +--FILE-- +<?php + +$xml = <<<XML +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <int>1</int> + </value> +</param> +</params> +XML; + +$response = xmlrpc_decode($xml); +echo $response; + +--EXPECT-- +1
\ No newline at end of file |