package.xml 0000644 0001750 0001750 00000065150 11603076666 014001 0 ustar clockwerx clockwerx XML_RPC2 pear.php.net XML-RPC client/server library XML_RPC2 is a pear package providing XML_RPC client and server services. XML-RPC is a simple remote procedure call protocol built using HTTP as transport and XML as encoding. As a client library, XML_RPC2 is capable of creating a proxy class which exposes the methods exported by the server. As a server library, XML_RPC2 is capable of exposing methods from a class or object instance, seamlessly exporting local methods as remotely callable procedures. Sergio Carvalho sergiosgc sergiosgc@php.net yes Fabien MARTY fab fab@php.net yes Alan Langford instance jal@ambitonline.com yes 2011-06-30 13:44:22 1.1.1 1.0.5 stable stable PHP License 3.02 QA release Better usage of HTTP_Request2, allowing the use of pre-configured instances now Bug #18329 Fatal error in HTTPRequest.php Bug #18404 PHP Notice about undefined property: XML_RPC2_Server_Input_PhpInput::$readReque 5.0.0 1.5.4 HTTP_Request2 pear.php.net 0.6.0 Cache_Lite pear.php.net 1.6.0 1.1.1 1.0.5 stable stable 2011-06-30 PHP License 3.02 QA release Better usage of HTTP_Request2, allowing the use of pre-configured instances now Bug #18329 Fatal error in HTTPRequest.php Bug #18404 PHP Notice about undefined property: XML_RPC2_Server_Input_PhpInput::$readReque 1.1.0b3 1.0.5 beta stable 2011-02-26 PHP License 3.02 Better usage of HTTP_Request2, allowing the use of pre-configured instances now 1.1.0b2 1.0.5 beta stable 2011-02-26 PHP License 3.02 Fix missing files in packaged version XML_RPC2-1.1.1/docs/tutorials/XML_RPC2.lyx 0000600 0001750 0001750 00000014476 11603076665 020504 0 ustar clockwerx clockwerx #LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass docbook-section \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Title \added_space_top vfill \added_space_bottom vfill XML_RPC2 Tutorial \layout Abstract This tutorial introduces basic usage of XML_RPC2 as a client/server library in XML_RPC operations. XML_RPC2 is a pear package providing XML_RPC client and server services. XML-RPC is a simple remote procedure call protocol built using HTTP as transport and XML as encoding. \layout Abstract As a client library, XML_RPC2 is capable of creating a proxy class which exposes the methods exported by the server. As a server library, XML_RPC2 is capable of exposing methods from a class or object instance, seamlessly exporting local methods as remotely callable procedures. \layout Subsection Client usage \layout Subsubsection Basic Usage \layout Standard The most simple way to use the XML_RPC client is by letting XML_RPC2 select the backend for you, and just give the client factory method the data referring to the server: \layout Itemize The server URI. \layout Itemize The HTTP proxy URI (null if no proxy). \layout Itemize The method prefix \layout Code require_once('XML/RPC2/Client.php'); \layout Code $client = XML_RPC2_Client::create('http://rpc.example.com:80/', null, ''); \layout Standard The factory will produce a client proxy. This class exports whichever methods the server exports. These methods are called just like regular local methods: \layout Code print($client->hello('World')); \layout Standard for a server that exports the method hello. If the server has methods prefixed by a classname (example.hello), there are two solutions. Either call the method using brackets enclosing the otherwise php-invalid method name: \layout Code print($client->{example.hello}('World')); \layout Standard Or specify a method prefix when creating the client instance: \layout Code $client = XML_RPC2_Client::create('http://rpc.example.com:80/', null, 'example.'); \layout Code print($client->hello('World')); \layout Subsubsection Error handling \layout Standard XML_RPC2 uses exceptions to signal errors. The phpdoc reference contains a class hierarchy useful to get a grasp of possible errors. The most important characteristics of the XML_RPC2 exception tree are: \layout Itemize All XML_RPC2 exceptions are children of XML_RPC2_Exception. If you want to filter out exceptions from this package, catch XML_RPC2_Exceptio n \layout Itemize Network failure is signaled by an XML_RPC2_TransportException \layout Itemize Regular XML-RPC fault responses are signaled by an XML_RPC2_FaultException \layout Itemize All other types of XML_RPC2_Exception signal package misuse or bug-induced misbehaviour \layout Standard Standard usage: \layout Code require_once('XMLrequire_once('XML/RPC2/Client.php'); \layout Code try { \layout Code $client = XML_RPC2_Client::create('http://rpc.example.com:80/', null, ''); \layout Code print($client->hello('World')); \layout Code } catch (XML_RPC2_TransportException transportException) { \layout Code // Handle network-induced exception \layout Code } catch (XML_RPC2_FaultException fault) { \layout Code // Handle fault returned by remote server \layout Code } catch (XML_RPC2_Exception xmlRpcException) { \layout Code // Handle abnormal XML_RPC2 package exception \layout Code } catch (Exception e) { \layout Code // Handle someone else's fault exception \layout Code } \layout Standard It is good practice to at least expect XML_RPC2_TransportException as network failure can't ever be ruled out. \layout Subsection Server usage \layout Subsubsection Basic Usage \layout Standard To export an XML-RPC server using XML_RPC2, the first step is writing the methods to export. XML_RPC2 can export class methods (static methods) for a class, or all methods for an object instance. For this example, we'll export a class' static methods: \layout Code class EchoServer { \layout Code /** \layout Code * echoecho echoes the message received \layout Code * \layout Code * @param string Message \layout Code * @return string The echo \layout Code */ \layout Code \layout Code public static function echoecho($string) \layout Code { \layout Code return $string; \layout Code } \layout Code \layout Code /** \layout Code * Dummy method which won't be exported \layout Code * \layout Code * @xmlrpc.hidden \layout Code */ \layout Code public static function dummy() \layout Code { \layout Code return false; \layout Code } \layout Code \layout Code /** \layout Code * hello says hello \layout Code * \layout Code * @param string Name \layout Code * @return string Hello 'name' \layout Code */ \layout Code public function hello($name) \layout Code { \layout Code return "Hello $name"; \layout Code } \layout Code \layout Code } \layout Standard Note that the method is documented using phpDoc docblocks. The docblock is used to deduce the signature and method documentation, required by the XML-RPC spec. Non-documented methods are not exported. Methods tagged with the tag @xmlrpc.hidden are not exported either (the dummy method above won't be exported). \layout Standard After creating the class, we need to get an XML_RPC2 server to export its methods remotely: \layout Code require_once 'XML/RPC2/Server.php'; \layout Code $server = XML_RPC2_Server::create('EchoServer'); \layout Code $server->handleCall(); \layout Standard The XML_RPC2_Server automatically exports all of the EchoServer class public static methods (echoecho in this case). You may also export all of an instance's public methods (static or otherwise): \layout Code require_once 'XML/RPC2/Server.php'; \layout Code $server = XML_RPC2_Server::create(new EchoServer()); \layout Code $server->handleCall(); \the_end XML_RPC2-1.1.1/docs/Makefile 0000600 0001750 0001750 00000000012 11603076665 016107 0 ustar clockwerx clockwerx phpdoc: XML_RPC2-1.1.1/tests/lib/run-tests 0000600 0001750 0001750 00000066145 11603076665 017341 0 ustar clockwerx clockwerx $value) { putenv("$key=$value"); } /* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2002 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Ilia Alshanetsky | | Preston L. Bannister | | Marcus Boerger | | Derick Rethans | | Sander Roobol | | (based on version by: Stig Bakken ) | | (based on the PHP 3 test framework by Rasmus Lerdorf) | +----------------------------------------------------------------------+ */ /* Require exact specification of PHP executable to test (no guessing!). Die if any internal errors encountered in test script. Regularized output for simpler post-processing of output. Optionally output error lines indicating the failing test source and log for direct jump with MSVC or Emacs. */ /* * TODO: * - do not test PEAR components if base class and/or component class cannot be instanciated */ /* Sanity check to ensure that pcre extension needed by this script is avaliable. * In the event it is not, print a nice error message indicating that this script will * not run without it. */ if (!extension_loaded("pcre")) { echo <<'; save_text($info_file, $php_info); global $ini_overwrites; $ini_overwrites = array( 'mbstring.script_encoding=pass', 'output_handler=', 'zlib.output_compression=Off', 'open_basedir=', 'safe_mode=0', 'disable_functions=', 'output_buffering=Off', 'error_reporting=2047', 'display_errors=1', 'log_errors=0', 'html_errors=0', 'track_errors=1', 'report_memleaks=1', 'docref_root=/phpmanual/', 'docref_ext=.html', 'error_prepend_string=', 'error_append_string=', 'auto_prepend_file=', 'auto_append_file=', 'magic_quotes_runtime=0', ); global $info_params; $info_params = array(); settings2array($ini_overwrites,$info_params); $save = $info_params; settings2paramsnoquotes($info_params); $curdir = getcwd(); chdir(dirname($info_file)); $info_filename = basename($info_file); $php_info = `"$php" $info_params $info_filename`; chdir($curdir); @unlink($info_file); //$info_params = $save; //settings2params($info_params); define('TESTED_PHP_VERSION', `"$php" -r 'echo PHP_VERSION;'`); // Write test context information. echo " ===================================================================== CWD : $cwd PHP : $php $php_info Extra dirs : "; foreach ($user_tests as $test_dir) { echo "{$test_dir}\n "; } echo " ===================================================================== "; // Determine the tests to be run. global $test_files, $test_results; $test_files = array(); $test_results = array(); $GLOBALS['__PHP_FAILED_TESTS__'] = array(); // If parameters given assume they represent selected tests to run. if (isset($argc) && $argc > 1) { for ($i=1; $i<$argc; $i++) { $testfile = realpath($argv[$i]); if (is_dir($testfile)) { find_files($testfile); } else if (preg_match("/\.phpt$/", $testfile)) { $test_files[] = $testfile; } } $test_files = array_unique($test_files); // Run selected tests. if (count($test_files)) { usort($test_files, "test_sort"); echo "Running selected tests.\n"; foreach($test_files AS $name) { $test_results[$name] = run_test($php,$name); } if (getenv('REPORT_EXIT_STATUS') == 1 and @ereg('FAILED( |$)', implode(' ', $test_results))) { exit(1); } exit(0); } } // Compile a list of all test files (*.phpt). $test_files = array(); $exts_to_test = get_loaded_extensions(); $exts_tested = count($exts_to_test); $exts_skipped = 0; $ignored_by_ext = 0; sort($exts_to_test); $test_dirs = array('tests', 'pear', 'ext'); foreach ($test_dirs as $dir) { find_files("{$cwd}/{$dir}", ($dir == 'ext')); } foreach ($user_tests as $dir) { find_files($dir, ($dir == 'ext')); } function find_files($dir,$is_ext_dir=FALSE,$ignore=FALSE) { print($dir . "\n"); global $test_files, $exts_to_test, $ignored_by_ext, $exts_skipped, $exts_tested; $o = opendir($dir) or error("cannot open directory: $dir"); while (($name = readdir($o)) !== FALSE) { if (is_dir("{$dir}/{$name}") && !in_array($name, array('.', '..', 'CVS'))) { $skip_ext = ($is_ext_dir && !in_array($name, $exts_to_test)); if ($skip_ext) { $exts_skipped++; } find_files("{$dir}/{$name}", FALSE, $ignore || $skip_ext); } // Cleanup any left-over tmp files from last run. if (substr($name, -4) == '.tmp') { @unlink("$dir/$name"); continue; } // Otherwise we're only interested in *.phpt files. if (substr($name, -5) == '.phpt') { if ($ignore) { $ignored_by_ext++; } else { $testfile = realpath("{$dir}/{$name}"); $test_files[] = $testfile; } } } closedir($o); } function test_sort($a, $b) { global $cwd; $ta = strpos($a, "{$cwd}/tests")===0 ? 1 + (strpos($a, "{$cwd}/tests/run-test")===0 ? 1 : 0) : 0; $tb = strpos($b, "{$cwd}/tests")===0 ? 1 + (strpos($b, "{$cwd}/tests/run-test")===0 ? 1 : 0) : 0; if ($ta == $tb) { return strcmp($a, $b); } else { return $tb - $ta; } } $test_files = array_unique($test_files); usort($test_files, "test_sort"); $start_time = time(); echo "TIME START " . date('Y-m-d H:i:s', $start_time) . " ===================================================================== "; foreach ($test_files as $name) { $test_results[$name] = run_test($php,$name); } $end_time = time(); // Summarize results if (0 == count($test_results)) { echo "No tests were run.\n"; return; } $n_total = count($test_results); $n_total += $ignored_by_ext; $sum_results = array('PASSED'=>0, 'WARNED'=>0, 'SKIPPED'=>0, 'FAILED'=>0); foreach ($test_results as $v) { $sum_results[$v]++; } $sum_results['SKIPPED'] += $ignored_by_ext; $percent_results = array(); while (list($v,$n) = each($sum_results)) { $percent_results[$v] = (100.0 * $n) / $n_total; } echo " ===================================================================== TIME END " . date('Y-m-d H:i:s', $end_time); $summary = " ===================================================================== TEST RESULT SUMMARY --------------------------------------------------------------------- Exts skipped : " . sprintf("%4d",$exts_skipped) . " Exts tested : " . sprintf("%4d",$exts_tested) . " --------------------------------------------------------------------- Number of tests : " . sprintf("%4d",$n_total) . " Tests skipped : " . sprintf("%4d (%2.1f%%)",$sum_results['SKIPPED'],$percent_results['SKIPPED']) . " Tests warned : " . sprintf("%4d (%2.1f%%)",$sum_results['WARNED'],$percent_results['WARNED']) . " Tests failed : " . sprintf("%4d (%2.1f%%)",$sum_results['FAILED'],$percent_results['FAILED']) . " Tests passed : " . sprintf("%4d (%2.1f%%)",$sum_results['PASSED'],$percent_results['PASSED']) . " --------------------------------------------------------------------- Time taken : " . sprintf("%4d seconds", $end_time - $start_time) . " ===================================================================== "; echo $summary; $failed_test_summary = ''; if (count($GLOBALS['__PHP_FAILED_TESTS__'])) { $failed_test_summary .= " ===================================================================== FAILED TEST SUMMARY --------------------------------------------------------------------- "; foreach ($GLOBALS['__PHP_FAILED_TESTS__'] as $failed_test_data) { $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; } $failed_test_summary .= "=====================================================================\n"; } if ($failed_test_summary && !getenv('NO_PHPTEST_SUMMARY')) { echo $failed_test_summary; } define('PHP_QA_EMAIL', 'php-qa@lists.php.net'); define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php'); /* We got failed Tests, offer the user to send and e-mail to QA team, unless NO_INTERACTION is set */ if (!getenv('NO_INTERACTION')) { $fp = fopen("php://stdin", "r+"); echo "\nPlease allow this report to be sent to the PHP QA\nteam. This will give us a better understanding in how\n"; echo "PHP's test cases are doing. Note that the report will include\ndetailed configuration data about your system\n"; echo "so if you are worried about exposing sensitive data,\nsave this to a file first and remove any sensitive data\n"; echo "and then send this file to php-qa@lists.php.net.\n"; echo "(choose \"s\" to just save the results to a file)? [Yns]: "; flush(); $user_input = fgets($fp, 10); $just_save_results = (strtolower($user_input[0]) == 's'); if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { /* * Collect information about the host system for our report * Fetch phpinfo() output so that we can see the PHP enviroment * Make an archive of all the failed tests * Send an email */ /* Ask the user to provide an email address, so that QA team can contact the user */ if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) { echo "\nPlease enter your email address.\n(You address will be mangled so that it will not go out on any\nmailinglist in plain text): "; flush(); $fp = fopen("php://stdin", "r+"); $user_email = trim(fgets($fp, 1024)); $user_email = str_replace("@", " at ", str_replace(".", " dot ", $user_email)); } $failed_tests_data = ''; $sep = "\n" . str_repeat('=', 80) . "\n"; $failed_tests_data .= $failed_test_summary . "\n"; $failed_tests_data .= $summary . "\n"; if ($sum_results['FAILED']) { foreach ($GLOBALS['__PHP_FAILED_TESTS__'] as $test_info) { $failed_tests_data .= $sep . $test_info['name'] . $test_info['info']; $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output'])); $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff'])); $failed_tests_data .= $sep . "\n\n"; } $status = "failed"; } else { $status = "success"; } $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep; $failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n"; $ldd = $automake = $autoconf = $libtool = $compiler = 'N/A'; if (substr(PHP_OS, 0, 3) != "WIN") { $automake = shell_exec('automake --version'); $autoconf = shell_exec('autoconf --version'); /* Always use the generated libtool - Mac OSX uses 'glibtool' */ $libtool = shell_exec('./libtool --version'); /* Try the most common flags for 'version' */ $flags = array('-v', '-V', '--version'); $cc_status=0; foreach($flags AS $flag) { system(getenv('CC')." $flag >/dev/null 2>&1", $cc_status); if ($cc_status == 0) { $compiler = shell_exec(getenv('CC')." $flag 2>&1"); break; } } $ldd = shell_exec("ldd $php"); } $failed_tests_data .= "Automake:\n$automake\n"; $failed_tests_data .= "Autoconf:\n$autoconf\n"; $failed_tests_data .= "Libtool:\n$libtool\n"; $failed_tests_data .= "Compiler:\n$compiler\n"; $failed_tests_data .= "Bison:\n". @shell_exec('bison --version'). "\n"; $failed_tests_data .= "Libraries:\n$ldd\n"; $failed_tests_data .= "\n"; if (isset($user_email)) { $failed_tests_data .= "User's E-mail: ".$user_email."\n\n"; } $failed_tests_data .= $sep . "PHPINFO" . $sep; $failed_tests_data .= shell_exec($php.' -dhtml_errors=0 -i'); $compression = 0; if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) { $output_file = 'php_test_results_' . date('Ymd') . ( $compression ? '.txt.gz' : '.txt' ); $fp = fopen($output_file, "w"); fwrite($fp, $failed_tests_data); fclose($fp); if (!$just_save_results) { echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n"; } echo "Please send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n"; } else { fwrite($fp, "\nThank you for helping to make PHP better.\n"); fclose($fp); } } } if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) { exit(1); } // // Send Email to QA Team // function mail_qa_team($data, $compression, $status = FALSE) { $url_bits = parse_url(QA_SUBMISSION_PAGE); if (empty($url_bits['port'])) $url_bits['port'] = 80; $data = "php_test_data=" . urlencode(base64_encode(preg_replace("/[\\x00]/", "[0x0]", $data))); $data_length = strlen($data); $fs = fsockopen($url_bits['host'], $url_bits['port'], $errno, $errstr, 10); if (!$fs) { return FALSE; } $php_version = urlencode(TESTED_PHP_VERSION); echo "\nPosting to {$url_bits['host']} {$url_bits['path']}\n"; fwrite($fs, "POST ".$url_bits['path']."?status=$status&version=$php_version HTTP/1.1\r\n"); fwrite($fs, "Host: ".$url_bits['host']."\r\n"); fwrite($fs, "User-Agent: QA Browser 0.1\r\n"); fwrite($fs, "Content-Type: application/x-www-form-urlencoded\r\n"); fwrite($fs, "Content-Length: ".$data_length."\r\n\r\n"); fwrite($fs, $data); fwrite($fs, "\r\n\r\n"); fclose($fs); return 1; } // // Write the given text to a temporary file, and return the filename. // function save_text($filename,$text) { $fp = @fopen($filename,'w') or error("Cannot open file '" . $filename . "' (save_text)"); fwrite($fp,$text); fclose($fp); if (1 < DETAILED) echo " FILE $filename {{{ $text }}} "; } // // Write an error in a format recognizable to Emacs or MSVC. // function error_report($testname,$logname,$tested) { $testname = realpath($testname); $logname = realpath($logname); switch (strtoupper(getenv('TEST_PHP_ERROR_STYLE'))) { case 'MSVC': echo $testname . "(1) : $tested\n"; echo $logname . "(1) : $tested\n"; break; case 'EMACS': echo $testname . ":1: $tested\n"; echo $logname . ":1: $tested\n"; break; } } // // Run an individual test case. // function run_test($php,$file) { global $log_format, $info_params, $ini_overwrites; if (DETAILED) echo " ================= TEST $file "; // Load the sections of the test file. $section_text = array( 'TEST' => '(unnamed test)', 'SKIPIF' => '', 'GET' => '', 'ARGS' => '', ); $fp = @fopen($file, "r") or error("Cannot open test file: $file"); $section = ''; while (!feof($fp)) { $line = fgets($fp); // Match the beginning of a section. if (@ereg('^--([A-Z]+)--',$line,$r)) { $section = $r[1]; $section_text[$section] = ''; continue; } // Add to the section text. $section_text[$section] .= $line; } fclose($fp); /* For GET/POST tests, check if cgi sapi is avaliable and if it is, use it. */ if ((!empty($section_text['GET']) || !empty($section_text['POST']))) { if (file_exists("./sapi/cgi/php")) { $old_php = $php; $php = realpath("./sapi/cgi/php") . ' -C '; } } $shortname = str_replace($GLOBALS['cwd'].'/', '', $file); $tested = trim($section_text['TEST'])." [$shortname]"; $tmp = realpath(dirname($file)); if (!is_dir($tmp)) { $tmp = dirname($file); } $tmp_skipif = $tmp . uniqid('/phpt.'); $tmp_file = @ereg_replace('\.phpt$','.php',$file); $tmp_post = $tmp . uniqid('/phpt.'); @unlink($tmp_skipif); @unlink($tmp_file); @unlink($tmp_post); // unlink old test results @unlink(@ereg_replace('\.phpt$','.diff',$file)); @unlink(@ereg_replace('\.phpt$','.log',$file)); @unlink(@ereg_replace('\.phpt$','.exp',$file)); @unlink(@ereg_replace('\.phpt$','.out',$file)); // Reset environment from any previous test. putenv("REDIRECT_STATUS="); putenv("QUERY_STRING="); putenv("PATH_TRANSLATED="); putenv("SCRIPT_FILENAME="); putenv("REQUEST_METHOD="); putenv("CONTENT_TYPE="); putenv("CONTENT_LENGTH="); // Check if test should be skipped. $info = ''; $warn = false; if (array_key_exists('SKIPIF', $section_text)) { if (trim($section_text['SKIPIF'])) { save_text($tmp_skipif, $section_text['SKIPIF']); $curdir = getcwd(); chdir(dirname($tmp_skipif)); $t_s = basename($tmp_skipif); $output = `"$php" $info_params -f $t_s`; chdir($curdir); @unlink($tmp_skipif); if (@eregi("^skip", trim($output))) { echo "SKIP $tested"; $reason = (@eregi("^skip[[:space:]]*(.+)\$", trim($output))) ? @eregi_replace("^skip[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE; if ($reason) { echo " (reason: $reason)\n"; } else { echo "\n"; } if (isset($old_php)) { $php = $old_php; } return 'SKIPPED'; } if (@eregi("^info", trim($output))) { $reason = (@ereg("^info[[:space:]]*(.+)\$", trim($output))) ? @ereg_replace("^info[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE; if ($reason) { $info = " (info: $reason)"; } } if (@eregi("^warn", trim($output))) { $reason = (@ereg("^warn[[:space:]]*(.+)\$", trim($output))) ? @ereg_replace("^warn[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE; if ($reason) { $warn = true; /* only if there is a reason */ $info = " (warn: $reason)"; } } } } // Default ini settings $ini_settings = array(); // additional ini overwrites //$ini_overwrites[] = 'setting=value'; settings2array($ini_overwrites, $ini_settings); // Any special ini settings // these may overwrite the test defaults... if (array_key_exists('INI', $section_text)) { settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings); } settings2paramsnoquotes($ini_settings); // We've satisfied the preconditions - run the test! save_text($tmp_file,$section_text['FILE']); if (array_key_exists('GET', $section_text)) { $query_string = trim($section_text['GET']); } else { $query_string = ''; } putenv("REDIRECT_STATUS=1"); putenv("QUERY_STRING=$query_string"); putenv("PATH_TRANSLATED=$tmp_file"); putenv("SCRIPT_FILENAME=$tmp_file"); $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : ''; if (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) { $post = trim($section_text['POST']); save_text($tmp_post,$post); $content_length = strlen($post); putenv("REQUEST_METHOD=POST"); putenv("CONTENT_TYPE=application/x-www-form-urlencoded"); putenv("CONTENT_LENGTH=$content_length"); $cmd = "\"$php\"$ini_settings -f $tmp_file 2>&1 < \"$tmp_post\""; } else { putenv("REQUEST_METHOD=GET"); putenv("CONTENT_TYPE="); putenv("CONTENT_LENGTH="); $cmd = "\"$php\"$ini_settings -f $tmp_file$args 2>&1"; } if (DETAILED) echo " CONTENT_LENGTH = " . getenv("CONTENT_LENGTH") . " CONTENT_TYPE = " . getenv("CONTENT_TYPE") . " PATH_TRANSLATED = " . getenv("PATH_TRANSLATED") . " QUERY_STRING = " . getenv("QUERY_STRING") . " REDIRECT_STATUS = " . getenv("REDIRECT_STATUS") . " REQUEST_METHOD = " . getenv("REQUEST_METHOD") . " SCRIPT_FILENAME = " . getenv("SCRIPT_FILENAME") . " COMMAND $cmd "; $out = `$cmd`; @unlink($tmp_post); // Does the output match what is expected? $output = trim($out); $output = preg_replace('/\r\n/',"\n",$output); /* when using CGI, strip the headers from the output */ if (isset($old_php) && ($pos = strpos($output, "\n\n")) !== FALSE) { $output = substr($output, ($pos + 2)); } if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) { if (isset($section_text['EXPECTF'])) { $wanted = trim($section_text['EXPECTF']); } else { $wanted = trim($section_text['EXPECTREGEX']); } $wanted_re = preg_replace('/\r\n/',"\n",$wanted); if (isset($section_text['EXPECTF'])) { $wanted_re = preg_quote($wanted_re, '/'); // Stick to basics $wanted_re = str_replace("%s", ".+?", $wanted_re); //not greedy $wanted_re = str_replace("%i", "[+\-]?[0-9]+", $wanted_re); $wanted_re = str_replace("%d", "[0-9]+", $wanted_re); $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re); $wanted_re = str_replace("%f", "[+\-]?\.?[0-9]+\.?[0-9]*(E-?[0-9]+)?", $wanted_re); $wanted_re = str_replace("%c", ".", $wanted_re); // %f allows two points "-.0.0" but that is the best *simple* expression } /* DEBUG YOUR REGEX HERE var_dump($wanted_re); print(str_repeat('=', 80) . "\n"); var_dump($output); */ if (preg_match("/^$wanted_re\$/s", $output)) { @unlink($tmp_file); echo "PASS $tested$info\n"; if (isset($old_php)) { $php = $old_php; } return 'PASSED'; } } else { $wanted = trim($section_text['EXPECT']); $wanted = preg_replace('/\r\n/',"\n",$wanted); // compare and leave on success $ok = (0 == strcmp($output,$wanted)); if ($ok) { @unlink($tmp_file); echo "PASS $tested$info\n"; if (isset($old_php)) { $php = $old_php; } return 'PASSED'; } } // Test failed so we need to report details. if ($warn) { echo "WARN $tested$info\n"; } else { echo "FAIL $tested$info\n"; } $GLOBALS['__PHP_FAILED_TESTS__'][] = array( 'name' => $file, 'test_name' => $tested, 'output' => @ereg_replace('\.phpt$','.log', $file), 'diff' => @ereg_replace('\.phpt$','.diff', $file), 'info' => $info ); // write .exp if (strpos($log_format,'E') !== FALSE) { $logname = @ereg_replace('\.phpt$','.exp',$file); $log = fopen($logname,'w') or error("Cannot create test log - $logname"); fwrite($log,$wanted); fclose($log); } // write .out if (strpos($log_format,'O') !== FALSE) { $logname = @ereg_replace('\.phpt$','.out',$file); $log = fopen($logname,'w') or error("Cannot create test log - $logname"); fwrite($log,$output); fclose($log); } // write .diff if (strpos($log_format,'D') !== FALSE) { $logname = @ereg_replace('\.phpt$','.diff',$file); $log = fopen($logname,'w') or error("Cannot create test log - $logname"); fwrite($log,generate_diff($wanted,$output)); fclose($log); } // write .log if (strpos($log_format,'L') !== FALSE) { $logname = @ereg_replace('\.phpt$','.log',$file); $log = fopen($logname,'w') or error("Cannot create test log - $logname"); fwrite($log," ---- EXPECTED OUTPUT $wanted ---- ACTUAL OUTPUT $output ---- FAILED "); fclose($log); error_report($file,$logname,$tested); } if (isset($old_php)) { $php = $old_php; } return $warn ? 'WARNED' : 'FAILED'; } function generate_diff($wanted,$output) { $w = explode("\n", $wanted); $o = explode("\n", $output); $w1 = array_diff_assoc($w,$o); $o1 = array_diff_assoc($o,$w); $w2 = array(); $o2 = array(); foreach($w1 as $idx => $val) $w2[sprintf("%03d<",$idx)] = sprintf("%03d- ", $idx+1).$val; foreach($o1 as $idx => $val) $o2[sprintf("%03d>",$idx)] = sprintf("%03d+ ", $idx+1).$val; $diff = array_merge($w2, $o2); ksort($diff); return implode("\r\n", $diff); } function error($message) { echo "ERROR: {$message}\n"; exit(1); } function settings2array($settings, &$ini_settings) { foreach($settings as $setting) { if (strpos($setting, '=')!==false) { $setting = explode("=", $setting, 2); $name = trim(strtolower($setting[0])); $value = trim($setting[1]); $ini_settings[$name] = $value; } } } function settings2params(&$ini_settings) { if (count($ini_settings)) { $settings = ''; foreach($ini_settings as $name => $value) { $value = addslashes($value); $settings .= " -d \"$name=$value\""; } $ini_settings = $settings; } else { $ini_settings = ''; } } function settings2paramsnoquotes(&$ini_settings) { if (count($ini_settings)) { $settings = ''; foreach($ini_settings as $name => $value) { $value = addslashes($value); $settings .= " -d $name=$value"; } $ini_settings = $settings; } else { $ini_settings = ''; } } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: noet sw=4 ts=4 */ ?> XML_RPC2-1.1.1/tests/lib/tests-config 0000600 0001750 0001750 00000004355 11603076665 017775 0 ustar clockwerx clockwerx NULL, /* executable that will be tested. Not used for web based tests */ //'TEST_PHP_EXECUTABLE' => '/usr/bin/php', 'TEST_PHP_EXECUTABLE' => '/usr/bin/php', /* 'TEST_PHP_EXECUTABLE' => 'c:\Programas\php\php.exe', */ /* php.ini to use when executing php */ 'PHPRC' => NULL, /* log format */ 'TEST_PHP_LOG_FORMAT' => 'LEODC', /* debugging detail in output. */ 'TEST_PHP_DETAILED' => 0, /* error style for editors or IDE's */ 'TEST_PHP_ERROR_STYLE' => 'EMACS', 'REPORT_EXIT_STATUS' => 1, 'NO_PHPTEST_SUMMARY' => 0, /* don't ask, and don't send results to QA if true */ 'NO_INTERACTION' => true, /* base url prefixed to any requests */ 'TEST_WEB_BASE_URL' => NULL, /* if set, copy phpt files into this directory, which should be accessable via an http server. The TEST_WEB_BASE_URL setting should be the base url to access this path. If this is not used, TEST_WEB_BASE_URL should be the base url pointing to TEST_PHP_SRCDIR, which should then be accessable via an http server. An example would be: TEST_WEB_BASE_URL=http://localhost/test TEST_BASE_PATH=/path/to/htdocs/test */ 'TEST_BASE_PATH' => NULL, /* file extension of pages requested via http this allows for php to be configured to parse extensions other than php, usefull for multiple configurations under a single webserver */ 'TEST_WEB_EXT' => 'php', /* if true doesn't run tests, just outputs executable info */ 'TEST_CONTEXT_INFO' => false, /* : or ; seperated list of paths */ 'TEST_PATHS' => 'XML_RPC2', /* 'TEST_PATHS' => 'xmlrpciBackend' */ /* additional configuration items that may be set to provide proxy support for testes: timeout proxy_host proxy_port proxy_user proxy_pass */ ); ?> ././@LongLink 0 0 0 156 0 003740 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOffByDefault1.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOffByDef0000600 0001750 0001750 00000002277 11603076665 033602 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedClient against phpxmlrpc validator1 (easyStructTest with cache off by default 1) --SKIPIF-- false, 'backend' => 'Php', 'prefix' => 'validator1.', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => false ), 'cacheDebug' => true ); $client = XML_RPC2_CachedClient::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->easyStructTest($arg); var_dump($result); $result = $client->easyStructTest($arg); var_dump($result); $client->dropCacheFile___('easyStructTest', $arg); ?> --EXPECT-- CACHE DEBUG : cache is not on by default and the called method is not listed in _cachedMethods => no cache ! int(19) CACHE DEBUG : cache is not on by default and the called method is not listed in _cachedMethods => no cache ! int(19) ././@LongLink 0 0 0 156 0 003740 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOffByDefault2.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOffByDef0000600 0001750 0001750 00000002327 11603076665 033576 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedClient against phpxmlrpc validator1 (easyStructTest with cache off by default 2) --SKIPIF-- false, 'backend' => 'Php', 'prefix' => 'validator1.', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => false, 'cachedMethods' => array('foo', 'bar', 'easyStructTest', 'foo2', 'bar2') ), 'cacheDebug' => true ); $client = XML_RPC2_CachedClient::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->easyStructTest($arg); var_dump($result); $result = $client->easyStructTest($arg); var_dump($result); $result = $client->easyStructTest($arg); var_dump($result); $client->dropCacheFile___('easyStructTest', array($arg)); ?> --EXPECT-- CACHE DEBUG : cache is not hit ! int(19) CACHE DEBUG : cache is hit ! int(19) CACHE DEBUG : cache is hit ! int(19) ././@LongLink 0 0 0 155 0 003737 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefault1.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefa0000600 0001750 0001750 00000002211 11603076665 033571 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedClient against phpxmlrpc validator1 (easyStructTest with cache on by default 1) --SKIPIF-- false, 'backend' => 'Php', 'prefix' => 'validator1.', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => true ), 'cacheDebug' => true ); $client = XML_RPC2_CachedClient::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->easyStructTest($arg); var_dump($result); $result = $client->easyStructTest($arg); var_dump($result); $result = $client->easyStructTest($arg); var_dump($result); $client->dropCacheFile___('easyStructTest', array($arg)); ?> --EXPECT-- CACHE DEBUG : cache is not hit ! int(19) CACHE DEBUG : cache is hit ! int(19) CACHE DEBUG : cache is hit ! int(19) ././@LongLink 0 0 0 155 0 003737 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefault2.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefa0000600 0001750 0001750 00000002315 11603076665 033576 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedClient against phpxmlrpc validator1 (easyStructTest with cache on by default 2) --SKIPIF-- false, 'backend' => 'Php', 'prefix' => 'validator1.', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => true, 'notCachedMethods' => array('foo', 'bar', 'easyStructTest', 'foobar') ), 'cacheDebug' => true ); $client = XML_RPC2_CachedClient::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->easyStructTest($arg); var_dump($result); $result = $client->easyStructTest($arg); var_dump($result); $client->dropCacheFile___('easyStructTest', array($arg)); ?> --EXPECT-- CACHE DEBUG : the called method is listed in _notCachedMethods => no cache ! int(19) CACHE DEBUG : the called method is listed in _notCachedMethods => no cache ! int(19) ././@LongLink 0 0 0 155 0 003737 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefault3.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefa0000600 0001750 0001750 00000002220 11603076665 033571 0 ustar clockwerx clockwerx --TEST-- XMLRPCext Backend XML-RPC cachedClient against phpxmlrpc validator1 (easyStructTest with cache on by default 3) --SKIPIF-- false, 'backend' => 'Php', 'prefix' => 'validator1.', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 1, 'cacheByDefault' => true, 'cachedMethods' => array( 'foo' => 1, 'bar' => 2, 'easyStructTest' => 60 ) ), 'cacheDebug' => true ); $client = XML_RPC2_CachedClient::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->easyStructTest($arg); var_dump($result); sleep(3); $result = $client->easyStructTest($arg); var_dump($result); $client->dropCacheFile___('easyStructTest', array($arg)); ?> --EXPECT-- CACHE DEBUG : cache is not hit ! int(19) CACHE DEBUG : cache is hit ! int(19) ././@LongLink 0 0 0 155 0 003737 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefault4.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/phpxmlrpcValidator1EasyStructTestCacheOnByDefa0000600 0001750 0001750 00000002350 11603076665 033575 0 ustar clockwerx clockwerx --TEST-- XMLRPCext Backend XML-RPC cachedClient against phpxmlrpc validator1 (easyStructTest with cache on by default 4) --SKIPIF-- false, 'backend' => 'Xmlrpcext', 'prefix' => 'validator1.', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => true, 'cachedMethods' => array( 'foo' => 30, 'bar' => 10, 'easyStructTest' => -1, 'foobar' => 60 ) ), 'cacheDebug' => true ); $client = XML_RPC2_CachedClient::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->easyStructTest($arg); var_dump($result); $result = $client->easyStructTest($arg); var_dump($result); $client->dropCacheFile___('easyStructTest', array($arg)); ?> --EXPECT-- CACHE DEBUG : called method has a -1 lifetime value => no cache ! int(19) CACHE DEBUG : called method has a -1 lifetime value => no cache ! int(19) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedClient/tmpdir.inc 0000600 0001750 0001750 00000003525 11603076665 024522 0 ustar clockwerx clockwerx * to avoid an extra dependency for a single function. * * LICENSE: This source file is subject to version 3.01 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_01.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. */ require_once('PEAR.php'); define('FILE_WIN32', defined('OS_WINDOWS') ? OS_WINDOWS : !strncasecmp(PHP_OS, 'win', 3)); /** * Returns the temp directory according to either the TMP, TMPDIR, or * TEMP env variables. If these are not set it will also check for the * existence of /tmp, %WINDIR%\temp * * @static * @access public * @return string The system tmp directory */ function tmpDir() { if (FILE_WIN32) { if (isset($_ENV['TEMP'])) { return $_ENV['TEMP']; } if (isset($_ENV['TMP'])) { return $_ENV['TMP']; } if (isset($_ENV['windir'])) { return $_ENV['windir'] . '\\temp'; } if (isset($_ENV['SystemRoot'])) { return $_ENV['SystemRoot'] . '\\temp'; } if (isset($_SERVER['TEMP'])) { return $_SERVER['TEMP']; } if (isset($_SERVER['TMP'])) { return $_SERVER['TMP']; } if (isset($_SERVER['windir'])) { return $_SERVER['windir'] . '\\temp'; } if (isset($_SERVER['SystemRoot'])) { return $_SERVER['SystemRoot'] . '\\temp'; } return '\temp'; } if (isset($_ENV['TMPDIR'])) { return $_ENV['TMPDIR']; } if (isset($_SERVER['TMPDIR'])) { return $_SERVER['TMPDIR']; } return '/tmp'; } ?> XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/tmpdir.inc 0000600 0001750 0001750 00000003525 11603076665 024552 0 ustar clockwerx clockwerx * to avoid an extra dependency for a single function. * * LICENSE: This source file is subject to version 3.01 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_01.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. */ require_once('PEAR.php'); define('FILE_WIN32', defined('OS_WINDOWS') ? OS_WINDOWS : !strncasecmp(PHP_OS, 'win', 3)); /** * Returns the temp directory according to either the TMP, TMPDIR, or * TEMP env variables. If these are not set it will also check for the * existence of /tmp, %WINDIR%\temp * * @static * @access public * @return string The system tmp directory */ function tmpDir() { if (FILE_WIN32) { if (isset($_ENV['TEMP'])) { return $_ENV['TEMP']; } if (isset($_ENV['TMP'])) { return $_ENV['TMP']; } if (isset($_ENV['windir'])) { return $_ENV['windir'] . '\\temp'; } if (isset($_ENV['SystemRoot'])) { return $_ENV['SystemRoot'] . '\\temp'; } if (isset($_SERVER['TEMP'])) { return $_SERVER['TEMP']; } if (isset($_SERVER['TMP'])) { return $_SERVER['TMP']; } if (isset($_SERVER['windir'])) { return $_SERVER['windir'] . '\\temp'; } if (isset($_SERVER['SystemRoot'])) { return $_SERVER['SystemRoot'] . '\\temp'; } return '\temp'; } if (isset($_ENV['TMPDIR'])) { return $_ENV['TMPDIR']; } if (isset($_SERVER['TMPDIR'])) { return $_SERVER['TMPDIR']; } return '/tmp'; } ?> ././@LongLink 0 0 0 145 0 003736 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOffByDefault1.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOffByDefault1.php0000600 0001750 0001750 00000004056 11603076665 033466 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedServer Validator1 test (easyStructTest with cache off by default 1) --FILE-- 'validator1.', 'backend' => 'Php', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => false ), 'cacheDebug' => true ); $server = XML_RPC2_CachedServer::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.easyStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $server->clean(); ?> --EXPECT-- CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=false, lifetime=60 CACHE DEBUG : we don't cache ! int(19) CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=false, lifetime=60 CACHE DEBUG : we don't cache ! int(19) ././@LongLink 0 0 0 145 0 003736 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOffByDefault2.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOffByDefault2.php0000600 0001750 0001750 00000004561 11603076665 033470 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedServer Validator1 test (easyStructTest with cache off by default 2) --FILE-- 'validator1.', 'backend' => 'Php', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => false ), 'cacheDebug' => true ); $server = XML_RPC2_CachedServer::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.easyStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $server->clean(); ?> --EXPECT-- CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=60 CACHE DEBUG : cache is not hit ! int(19) CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=60 CACHE DEBUG : cache is hit ! int(19) CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=60 CACHE DEBUG : cache is hit ! int(19) ././@LongLink 0 0 0 145 0 003736 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOffByDefault3.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOffByDefault3.php0000600 0001750 0001750 00000004557 11603076665 033476 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedServer Validator1 test (easyStructTest with cache off by default 3) --FILE-- 'validator1.', 'backend' => 'Php', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => false ), 'cacheDebug' => true ); $server = XML_RPC2_CachedServer::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.easyStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $server->clean(); ?> --EXPECT-- CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=30 CACHE DEBUG : cache is not hit ! int(19) CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=30 CACHE DEBUG : cache is hit ! int(19) CACHE DEBUG : default values => weCache=false, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=30 CACHE DEBUG : cache is hit ! int(19) ././@LongLink 0 0 0 144 0 003735 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOnByDefault1.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOnByDefault1.phpt0000600 0001750 0001750 00000004517 11603076665 033516 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedServer Validator1 test (easyStructTest with cache on by default 1) --FILE-- 'validator1.', 'backend' => 'Php', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => true ), 'cacheDebug' => true ); $server = XML_RPC2_CachedServer::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.easyStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $server->clean(); ?> --EXPECT-- CACHE DEBUG : default values => weCache=true, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=60 CACHE DEBUG : cache is not hit ! int(19) CACHE DEBUG : default values => weCache=true, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=60 CACHE DEBUG : cache is hit ! int(19) CACHE DEBUG : default values => weCache=true, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=true, lifetime=60 CACHE DEBUG : cache is hit ! int(19) ././@LongLink 0 0 0 144 0 003735 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOnByDefault2.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOnByDefault2.phpt0000600 0001750 0001750 00000004107 11603076665 033512 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedServer Validator1 test (easyStructTest with cache on by default 2) --FILE-- 'validator1.', 'backend' => 'Php', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => true ), 'cacheDebug' => true ); $server = XML_RPC2_CachedServer::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.easyStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $server->clean(); ?> --EXPECT-- CACHE DEBUG : default values => weCache=true, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=false, lifetime=60 CACHE DEBUG : we don't cache ! int(19) CACHE DEBUG : default values => weCache=true, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=false, lifetime=60 CACHE DEBUG : we don't cache ! int(19) ././@LongLink 0 0 0 144 0 003735 L XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOnByDefault3.phpt XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/cachedServer/validator1EasyStructTestCacheOnByDefault3.phpt0000600 0001750 0001750 00000004104 11603076665 033510 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC cachedServer Validator1 test (easyStructTest with cache on by default 3) --FILE-- 'validator1.', 'backend' => 'Php', 'cacheOptions' => array( 'cacheDir' => tmpDir() . '/', 'lifetime' => 60, 'cacheByDefault' => true ), 'cacheDebug' => true ); $server = XML_RPC2_CachedServer::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.easyStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); $server->clean(); ?> --EXPECT-- CACHE DEBUG : default values => weCache=true, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=false, lifetime=-1 CACHE DEBUG : we don't cache ! int(19) CACHE DEBUG : default values => weCache=true, lifetime=60 CACHE DEBUG : phpdoc comments => weCache=false, lifetime=-1 CACHE DEBUG : we don't cache ! int(19) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/faultFromPython.phpt 0000600 0001750 0001750 00000001605 11603076665 025473 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against python server returning fault response --SKIPIF-- --FILE-- invalidMethod('World'); } catch (XML_RPC2_FaultException $e) { var_dump($e->getMessage()); } ?> --EXPECT-- string(60) "exceptions.Exception:method "invalidMethod" is not supported" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/okFromPython.phpt 0000600 0001750 0001750 00000001373 11603076665 024773 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against python server returning normal response --SKIPIF-- --FILE-- echo('World')); ?> --EXPECT-- string(5) "World" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1ArrayOfStructsTest.phpt 0000600 0001750 0001750 00000001565 11603076665 032017 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (arrayOfStructsTest) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ), array( 'moe' => 5, 'larry' => 2, 'curly' => 4 ), array( 'moe' => 0, 'larry' => 1, 'curly' => 12 ) ); $result = $client->arrayOfStructsTest($arg); var_dump($result); ?> --EXPECT-- int(24) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1CountTheEntities.phpt 0000600 0001750 0001750 00000001526 11603076665 031457 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (countTheEntities) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $string = "foo <<< bar '> && '' #fo>o \" bar"; $result = $client->countTheEntities($string); var_dump($result['ctLeftAngleBrackets']); var_dump($result['ctRightAngleBrackets']); var_dump($result['ctAmpersands']); var_dump($result['ctApostrophes']); var_dump($result['ctQuotes']); ?> --EXPECT-- int(3) int(2) int(2) int(3) int(1) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1EasyStructTest.phpt 0000600 0001750 0001750 00000001240 11603076665 031160 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (easyStructTest) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->easyStructTest($arg); var_dump($result); ?> --EXPECT-- int(19) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1EchoStructTest.phpt 0000600 0001750 0001750 00000001350 11603076665 031137 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (echoStructTest) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $arg = array( 'moe' => 5, 'larry' => 6, 'curly' => 8 ); $result = $client->echoStructTest($arg); var_dump($result); ?> --EXPECT-- array(3) { ["moe"]=> int(5) ["larry"]=> int(6) ["curly"]=> int(8) } XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1ManyTypesTest.phpt 0000600 0001750 0001750 00000002325 11603076665 031010 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (manyTypesTest) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $tmp = "20060116T19:14:03"; $time = XML_RPC2_Value::createFromNative($tmp, 'datetime'); $base64 = XML_RPC2_Value::createFromNative('foobar', 'base64'); $result = $client->manyTypesTest(1, true, 'foo', 3.14159, $time, $base64); var_dump($result[0]); var_dump($result[1]); var_dump($result[2]); var_dump($result[3]); var_dump($result[4]->scalar); var_dump($result[4]->xmlrpc_type); var_dump($result[4]->timestamp); var_dump($result[5]->scalar); var_dump($result[5]->xmlrpc_type); ?> --EXPECT-- int(1) bool(true) string(3) "foo" float(3.14159) string(17) "20060116T19:14:03" string(8) "datetime" int(1137438843) string(6) "foobar" string(6) "base64" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1ModerateSizeArrayCheck.phpt 0000600 0001750 0001750 00000001315 11603076665 032545 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (moderateSizeArrayCheck) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $tmp = array('foo'); for ($i = 0 ; $i<150 ; $i++) { $tmp[] = "bla bla bla"; } $tmp[] = "bar"; $result = $client->moderateSizeArrayCheck($tmp); echo($result . "\n"); ?> --EXPECT-- foobar XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1NestedStructTest.phpt 0000600 0001750 0001750 00000002004 11603076665 031500 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (nestedStructTest) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $year1999 = array( '04' => array() ); $year2001 = $year1999; $year2000 = $year1999; $year2000['04']['01'] = array( 'moe' => 12, 'larry' => 14, 'curly' => 9 ); $index1999 = '1999 '; $index2000 = '2000 '; $index2001 = '2001 '; $cal = array(); $cal['1999'] = $year1999; $cal['2000'] = $year2000; $cal['2001'] = $year2001; require_once('XML/RPC2/Value.php'); $cal = XML_RPC2_Value::createFromNative($cal, 'struct'); $result = $client->nestedStructTest($cal); var_dump($result); ?> --EXPECT-- int(35) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/phpxmlrpcValidator1SimpleStructReturnTest.phpt 0000600 0001750 0001750 00000001312 11603076665 032710 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client against phpxmlrpc validator1 (simpleStructReturnTest) --SKIPIF-- --FILE-- false, 'backend' => 'Php', 'prefix' => 'validator1.' ); $client = XML_RPC2_Client::create('http://phpxmlrpc.sourceforge.net/server.php', $options); $result = $client->simpleStructReturnTest(13); var_dump($result['times10']); var_dump($result['times100']); var_dump($result['times1000']); ?> --EXPECT-- int(130) int(1300) int(13000) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/client/protocolError.phpt 0000600 0001750 0001750 00000001202 11603076665 025176 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC client with transport error --SKIPIF-- --FILE-- invalidMethod('World'); } catch (XML_RPC2_CurlException $e) { var_dump($e->getMessage()); } ?> --EXPECTREGEX-- string\(.*\) \"HTTP_Request2_Exception.* XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/array.phpt 0000600 0001750 0001750 00000001061 11603076665 023742 0 ustar clockwerx clockwerx --TEST-- Array XML-RPC decoding (Php Backend) --FILE-- 11a'))->getNativeValue()); ?> --EXPECT-- array(3) { [0]=> int(1) [1]=> bool(true) [2]=> string(1) "a" } XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/base64.phpt 0000600 0001750 0001750 00000001101 11603076665 023703 0 ustar clockwerx clockwerx --TEST-- Base64 XML-RPC decoding (Php Backend) --FILE-- VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2c='))->getNativeValue(); var_dump($result->xmlrpc_type); var_dump($result->scalar); ?> --EXPECT-- string(6) "base64" string(44) "The quick brown fox jumped over the lazy dog" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/boolean.phpt 0000600 0001750 0001750 00000001223 11603076665 024243 0 ustar clockwerx clockwerx --TEST-- Boolean XML-RPC decoding (Php Backend) --FILE-- 0'))->getNativeValue() ? 'true' : 'false'); printf("Native value: %s\n", XML_RPC2_Backend_Php_Value::createFromDecode(simplexml_load_string('1'))->getNativeValue() ? 'true' : 'false'); ?> --EXPECT-- Native value: false Native value: true XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/datetime.phpt 0000600 0001750 0001750 00000001111 11603076665 024414 0 ustar clockwerx clockwerx --TEST-- Datetime XML-RPC decoding (Php Backend) --FILE-- 2005'))->getNativeValue(); var_dump($result->xmlrpc_type); var_dump($result->scalar); var_dump($result->timestamp); ?> --EXPECT-- string(8) "datetime" string(4) "2005" int(1104537600) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/double.phpt 0000600 0001750 0001750 00000000650 11603076665 024101 0 ustar clockwerx clockwerx --TEST-- Double XML-RPC decoding (Php Backend) --FILE-- 1.25'))->getNativeValue()); ?> --EXPECT-- Native value: 1.25 XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/faultResponse.phpt 0000600 0001750 0001750 00000001335 11603076665 025462 0 ustar clockwerx clockwerx --TEST-- Response XML-RPC decoding (Php Backend) --FILE-- faultStringFailed to create homedir with: 0 faultCode200 XMLMARKER ))); } catch (Exception $e) { var_dump($e->getMessage()); } ?> --EXPECT-- string(32) "Failed to create homedir with: 0" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/integer.phpt 0000600 0001750 0001750 00000000637 11603076665 024271 0 ustar clockwerx clockwerx --TEST-- Integer XML-RPC decoding (Php Backend) --FILE-- 13'))->getNativeValue()); ?> --EXPECT-- Native value: 13 XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/integer2.phpt 0000600 0001750 0001750 00000000633 11603076665 024347 0 ustar clockwerx clockwerx --TEST-- Integer XML-RPC decoding (Php Backend) --FILE-- 7'))->getNativeValue()); ?> --EXPECT-- Native value: 7 XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/integer64.phpt 0000600 0001750 0001750 00000001024 11603076665 024432 0 ustar clockwerx clockwerx --TEST-- Integer XML-RPC decoding (Php Backend) --SKIPIF-- --FILE-- 34359738368'))->getNativeValue()); ?> --EXPECT-- Native value: 34359738368 XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/null.phpt 0000600 0001750 0001750 00000000713 11603076665 023601 0 ustar clockwerx clockwerx --TEST-- Integer XML-RPC decoding (Php Backend) --FILE-- '))->getNativeValue(); printf("Native value: %s\n", is_null($value) ? 'null' : 'not null'); ?> --EXPECT-- Native value: null XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/request.phpt 0000600 0001750 0001750 00000002274 11603076665 024323 0 ustar clockwerx clockwerx --TEST-- Request XML-RPC decoding (Php Backend) --FILE-- foo.bara string125125.21997071619203010')); var_dump($request->getMethodName()); $result = ($request->getParameters()); var_dump($result[0]); var_dump($result[1]); var_dump($result[2]); var_dump($result[3]->timestamp); var_dump($result[3]->xmlrpc_type); var_dump($result[3]->scalar); var_dump($result[4]); var_dump($result[5]); ?> --EXPECT-- string(7) "foo.bar" string(8) "a string" int(125) float(125.2) int(869011200) string(8) "datetime" string(14) "19970716192030" bool(true) bool(false) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/response.phpt 0000600 0001750 0001750 00000000720 11603076665 024463 0 ustar clockwerx clockwerx --TEST-- Response XML-RPC decoding (Php Backend) --FILE-- South Dakota'))); ?> --EXPECT-- string(12) "South Dakota" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/string.phpt 0000600 0001750 0001750 00000001374 11603076665 024141 0 ustar clockwerx clockwerx --TEST-- String XML-RPC decoding (Php Backend) --FILE-- The quick brown fox jumped over the lazy dog'))->getNativeValue()); printf("Native value: %s\n", XML_RPC2_Backend_Php_Value::createFromDecode(simplexml_load_string('The quick brown fox jumped over the lazy dog'))->getNativeValue()); ?> --EXPECT-- Native value: The quick brown fox jumped over the lazy dog Native value: The quick brown fox jumped over the lazy dog XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/decoding/struct.phpt 0000600 0001750 0001750 00000001203 11603076665 024146 0 ustar clockwerx clockwerx --TEST-- Struct XML-RPC decoding (Php Backend) --FILE-- a1b1ca string'))->getNativeValue()); ?> --EXPECT-- array(3) { ["a"]=> int(1) ["b"]=> bool(true) ["c"]=> string(8) "a string" } XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/array.phpt 0000600 0001750 0001750 00000000737 11603076665 023765 0 ustar clockwerx clockwerx --TEST-- Array XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(130) "11a string" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/base64.phpt 0000600 0001750 0001750 00000001241 11603076665 023722 0 ustar clockwerx clockwerx --TEST-- Base64 XML-RPC encoding (Php Backend) --FILE-- encode()); $string = new XML_RPC2_Backend_Php_Value_Base64('The brown fox jumped over the lazy dog'); var_dump($string->encode()); ?> --EXPECT-- string(77) "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2c=" string(81) "VGhlIDxxdWljaz4gYnJvd24gZm94IGp1bXBlZCBvdmVyIHRoZSBsYXp5IGRvZw==" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/boolean.phpt 0000600 0001750 0001750 00000000722 11603076665 024260 0 ustar clockwerx clockwerx --TEST-- Boolean XML-RPC encoding (Php Backend) --FILE-- encode()); $bool = new XML_RPC2_Backend_Php_Value_Boolean(false); var_dump($bool->encode()); ?> --EXPECT-- string(20) "1" string(20) "0" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/datetime.phpt 0000600 0001750 0001750 00000000655 11603076665 024442 0 ustar clockwerx clockwerx --TEST-- Datetime XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(54) "19970116T18:20:30" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/datetime1.phpt 0000600 0001750 0001750 00000000650 11603076665 024516 0 ustar clockwerx clockwerx --TEST-- Datetime XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(65) "1997-01-16T19:20:30.45+01:00" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/datetime2.phpt 0000600 0001750 0001750 00000000636 11603076665 024523 0 ustar clockwerx clockwerx --TEST-- Datetime XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(60) "1997-01-16T19:20:30.45Z" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/datetime3.phpt 0000600 0001750 0001750 00000000570 11603076665 024521 0 ustar clockwerx clockwerx --TEST-- Datetime XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(41) "2001" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/datetime4.phpt 0000600 0001750 0001750 00000000604 11603076665 024520 0 ustar clockwerx clockwerx --TEST-- Datetime XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(47) "1997-01-16" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/double.phpt 0000600 0001750 0001750 00000000725 11603076665 024116 0 ustar clockwerx clockwerx --TEST-- Double XML-RPC encoding (Php Backend) --FILE-- encode()); $double = new XML_RPC2_Backend_Php_Value_Double(123.79); var_dump($double->encode()); ?> --EXPECT-- string(18) "0" string(23) "123.79" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/integer.phpt 0000600 0001750 0001750 00000000533 11603076665 024276 0 ustar clockwerx clockwerx --TEST-- Integer XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(13) "53" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/integer64.phpt 0000600 0001750 0001750 00000000724 11603076665 024452 0 ustar clockwerx clockwerx --TEST-- Integer XML-RPC encoding (Php Backend) --SKIPIF-- --FILE-- encode()); ?> --EXPECT-- string(20) "34359738368" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/null.phpt 0000600 0001750 0001750 00000000505 11603076665 023612 0 ustar clockwerx clockwerx --TEST-- Nil XML-RPC encoding (Php Backend) --FILE-- encode()); ?> --EXPECT-- string(11) "" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/request.phpt 0000600 0001750 0001750 00000002046 11603076665 024332 0 ustar clockwerx clockwerx --TEST-- Request XML-RPC encoding (Php Backend) --FILE-- addParameter('a string'); $request->addParameter(125); $request->addParameter(125.2); $request->addParameter(new XML_RPC2_Backend_Php_Value_Datetime('2005-01-03')); $request->addParameter(true); $request->addParameter(false); var_dump($request->encode()); ?> --EXPECT-- string(440) "foo.bara string125125.22005-01-0310" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/response.phpt 0000600 0001750 0001750 00000001072 11603076665 024476 0 ustar clockwerx clockwerx --TEST-- Request XML-RPC encoding (Php Backend) --FILE-- --EXPECT-- string(248) "11a string" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/response2.phpt 0000600 0001750 0001750 00000001116 11603076665 024557 0 ustar clockwerx clockwerx --TEST-- Request XML-RPC encoding (Php Backend) --FILE-- --EXPECT-- string(271) "faultCode2faultStringA fault string" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/string.phpt 0000600 0001750 0001750 00000001205 11603076665 024144 0 ustar clockwerx clockwerx --TEST-- String XML-RPC encoding (Php Backend) --FILE-- encode()); $string = new XML_RPC2_Backend_Php_Value_String('The brown fox jumped over the lazy dog'); var_dump($string->encode()); ?> --EXPECT-- string(61) "The quick brown fox jumped over the lazy dog" string(69) "The <quick> brown fox jumped over the lazy dog" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/encoding/struct.phpt 0000600 0001750 0001750 00000001113 11603076665 024160 0 ustar clockwerx clockwerx --TEST-- Struct XML-RPC encoding (Php Backend) --FILE-- 1, 'b' => true, 'c' => 'a string')); var_dump($struct->encode()); ?> --EXPECT-- string(212) "a1b1ca string" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/regressions/11135.phpt 0000600 0001750 0001750 00000000770 11603076665 024073 0 ustar clockwerx clockwerx --TEST-- Regression guard against bug 11135: Empty array should not trigger notice --FILE-- createFromNative(array()); } ?> --EXPECT-- XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/invalidXMLRequest.phpt 0000600 0001750 0001750 00000002057 11603076665 025744 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server with non-existant method response --FILE-- echoecho World EOS ; $response = $server->getResponse(); try { XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response)); } catch (XML_RPC2_FaultException $e) { var_dump($e->getMessage()); } ?> --EXPECT-- string(27) "Unable to parse request XML" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/nonexistantMethod.phpt 0000600 0001750 0001750 00000002147 11603076665 026077 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server with non-existant method response --FILE-- example World EOS ; $response = $server->getResponse(); try { XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response)); } catch (XML_RPC2_FaultException $e) { var_dump($e->getFaultCode()); var_dump($e->getMessage()); } ?> --EXPECT-- int(-32601) string(40) "server error. requested method not found" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/normalRequest.phpt 0000600 0001750 0001750 00000001703 11603076665 025222 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server with normal response --FILE-- echoecho World EOS ; $response = $server->getResponse(); var_dump(XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); ?> --EXPECT-- string(5) "World" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/normalRequestWithPrefix.phpt 0000600 0001750 0001750 00000001772 11603076665 027242 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server with normal response (with prefix) --FILE-- 'prefixed.')); $GLOBALS['HTTP_RAW_POST_DATA'] = << prefixed.echoecho World EOS ; $response = $server->getResponse(); var_dump(XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); ?> --EXPECT-- string(5) "World" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/normalRequestWithPrefix2.phpt 0000600 0001750 0001750 00000002003 11603076665 027310 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server with normal response (with prefix in phpdoc) --FILE-- prefixed.echoecho World EOS ; $response = $server->getResponse(); var_dump(XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); ?> --EXPECT-- string(5) "World" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1ArrayOfStructsTest.phpt 0000600 0001750 0001750 00000004576 11603076665 030156 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (arrayOfStructsTest) --FILE-- 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.arrayOfStructsTest moe 5 larry 6 curly 8 moe 5 larry 2 curly 4 moe 0 larry 1 curly 12 EOS ; $response = $server->getResponse(); var_dump(XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); ?> --EXPECT-- int(24) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1CountTheEntities.phpt 0000600 0001750 0001750 00000003423 11603076665 027607 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (countTheEntities) --FILE-- '); $ctAmpersands = substr_count($string, '&'); $ctApostrophes = substr_count($string, "'"); $ctQuotes = substr_count($string, '"'); return array( 'ctLeftAngleBrackets' => $ctLeftAngleBrackets, 'ctRightAngleBrackets' => $ctRightAngleBrackets, 'ctAmpersands' => $ctAmpersands, 'ctApostrophes' => $ctApostrophes, 'ctQuotes' => $ctQuotes ); } } set_include_path(realpath(dirname(__FILE__) . '/../../../../') . PATH_SEPARATOR . get_include_path()); require_once 'XML/RPC2/Server.php'; $options = array( 'prefix' => 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.countTheEntities foo <<< bar '> && '' #fo>o " bar EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result['ctLeftAngleBrackets']); var_dump($result['ctRightAngleBrackets']); var_dump($result['ctAmpersands']); var_dump($result['ctApostrophes']); var_dump($result['ctQuotes']); ?> --EXPECT-- int(3) int(2) int(2) int(3) int(1) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1EasyStructTest.phpt 0000600 0001750 0001750 00000002532 11603076665 027317 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (easyStructTest) --FILE-- 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.easyStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); ?> --EXPECT-- int(19) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1EchoStructTest.phpt 0000600 0001750 0001750 00000002565 11603076665 027302 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (echoStructTest) --FILE-- 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.echoStructTest moe 5 larry 6 curly 8 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); ?> --EXPECT-- array(3) { ["moe"]=> int(5) ["larry"]=> int(6) ["curly"]=> int(8) } XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1ManyTypesTest.phpt 0000600 0001750 0001750 00000004072 11603076665 027143 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (manyTypesTest) --FILE-- 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.manyTypesTest 1 1 foo 3.141590 20060116T19:14:03 Zm9vYmFy EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result[0]); var_dump($result[1]); var_dump($result[2]); var_dump($result[3]); var_dump($result[4]->xmlrpc_type); var_dump($result[4]->scalar); var_dump($result[4]->timestamp); var_dump($result[5]->xmlrpc_type); var_dump($result[5]->scalar); ?> --EXPECT-- int(1) bool(true) string(3) "foo" float(3.14159) string(8) "datetime" string(17) "20060116T19:14:03" int(1137438843) string(6) "base64" string(6) "foobar" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1ModerateSizeArrayCheck.phpt 0000600 0001750 0001750 00000024436 11603076665 030710 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (moderateSizeArrayCheck) --FILE-- 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.moderateSizeArrayCheck foo bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bar EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); ?> --EXPECT-- string(6) "foobar" XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1NestedStructTest.phpt 0000600 0001750 0001750 00000005334 11603076665 027643 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (nestedStructTest) --FILE-- 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.nestedStructTest 1999 04 2000 04 01 moe 12 larry 14 curly 9 2001 04 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); ?> --EXPECT-- int(35) XML_RPC2-1.1.1/tests/XML_RPC2/phpBackend/server/validator1SimpleStructReturnTest.phpt 0000600 0001750 0001750 00000002337 11603076665 031052 0 ustar clockwerx clockwerx --TEST-- PHP Backend XML-RPC server Validator1 test (simpleStructReturnTest) --FILE-- 10 * $int, 'times100' => 100 * $int, 'times1000' => 1000 * $int ); } } set_include_path(realpath(dirname(__FILE__) . '/../../../../') . PATH_SEPARATOR . get_include_path()); require_once 'XML/RPC2/Server.php'; $options = array( 'prefix' => 'validator1.', 'backend' => 'Php' ); $server = XML_RPC2_Server::create('TestServer', $options); $GLOBALS['HTTP_RAW_POST_DATA'] = << validator1.simpleStructReturnTest 13 EOS ; $response = $server->getResponse(); $result = (XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($response))); var_dump($result); ?> --EXPECT-- array(3) { ["times10"]=> int(130) ["times100"]=> int(1300) ["times1000"]=> int(13000) } XML_RPC2-1.1.1/tests/XML_RPC2/regressions/11314.diff 0000600 0001750 0001750 00000007115 11603076665 021770 0 ustar clockwerx clockwerx 001- 001+ Fatal error: Uncaught exception 'XML_RPC2_Exception' with message 'XML_RPC2_Backend_Php does not support any encoding other than utf-8, due to a simplexml limitation' in /media/Elements_/backup/home/clockwerx/pear-svn/packages/XML_RPC2/trunk/XML/RPC2/Backend/Php/Server.php:82 002- 002+ Stack trace: 003- 003+ #0 /media/Elements_/backup/home/clockwerx/pear-svn/packages/XML_RPC2/trunk/XML/RPC2/Server.php(236): XML_RPC2_Backend_Php_Server->__construct(Object(XML_RPC2_Server_Callhandler_Class), Array) 004- 004+ #1 /media/Elements_/backup/home/clockwerx/pear-svn/packages/XML_RPC2/trunk/tests/XML_RPC2/regressions/11314.php(54): XML_RPC2_Server::create('DocumentationSe...', Array) 005- Available XMLRPC methods for this server 005+ #2 {main} 006- 021- 022- 023- Available XMLRPC methods for this server 024- Index 025- 026- test.getSomething() 027- 028- Details 029- 030- (string) test.getSomething((array) something, (string) another_thing, (boolean) credentials) 031- Description : 032- 033- returns something 034- 035- Parameters : 036- 037- TypeNameDocumentation 038- arraysomethingA description 039- stringanother_thingA description of another thing 040- booleancredentialsWhether to return nothing - server doesn't care though 041- 042- (return to index) 043- 044- 045-
Description :
Parameters :
(return to index)