summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2013-08-24 21:45:14 -0700
committerStanislav Malyshev <stas@php.net>2013-08-24 21:45:14 -0700
commita89e71397d5842e5a322378867ec571739d1c829 (patch)
tree3384ee1985e6fb9215667b3002b7862e52095733
parent286c745d81798cd794acf281bccfef66e97e0872 (diff)
parente22c139fe09db7e74ad027db49d76921fc1a19fd (diff)
downloadphp-git-a89e71397d5842e5a322378867ec571739d1c829.tar.gz
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
-rw-r--r--ext/xmlrpc/tests/005.phpt47
-rw-r--r--ext/xmlrpc/tests/006.phpt29
-rw-r--r--ext/xmlrpc/tests/007.phpt29
3 files changed, 105 insertions, 0 deletions
diff --git a/ext/xmlrpc/tests/005.phpt b/ext/xmlrpc/tests/005.phpt
new file mode 100644
index 0000000000..613dfde249
--- /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 0000000000..f33932d5a2
--- /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 0000000000..84c15a7d8a
--- /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