Commit: ac2d2b9b72d568fdd3d548d8fb22a85182a910a9 Author: root <root@precise64.(none)> Sun, 18 Aug 2013 18:44:52 +0000 Committer: Stanislav Malyshev <s...@php.net> Sun, 18 Aug 2013 13:59:39 -0700 Parents: 4a0e87e497ae77ef9e98ba7906f3c659c3ef289d Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ac2d2b9b72d568fdd3d548d8fb22a85182a910a9 Log: Create test to the extension xmlrpc Changed paths: A ext/xmlrpc/tests/003.phpt A ext/xmlrpc/tests/004.phpt Diff: diff --git a/ext/xmlrpc/tests/003.phpt b/ext/xmlrpc/tests/003.phpt new file mode 100644 index 0000000..3d6796d --- /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 0000000..04f3ef3 --- /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 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php