forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test extension xmlrpc encode type double and string decode type strin…
…g and int
- Loading branch information
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--TEST-- | ||
xmlrpc_encode() Simple test encode type double and String | ||
|
||
--CREDITS-- | ||
Michel Araujo <[email protected]> | ||
#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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--TEST-- | ||
xmlrpc_decode() Simple test decode type string | ||
|
||
--CREDITS-- | ||
Michel Araujo <[email protected]> | ||
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--TEST-- | ||
xmlrpc_decode() Simple test decode type int | ||
|
||
--CREDITS-- | ||
Michel Araujo <[email protected]> | ||
#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 |