From 53fa18cece7f0db6a3b02e7dc86db1ff9c80702a Mon Sep 17 00:00:00 2001 From: gggeek Date: Thu, 31 Dec 2020 15:34:23 +0000 Subject: [PATCH] shuffle stuff around --- .travis.yml | 4 ++-- NEWS | 3 ++- {extras => demo/client/perl}/test.pl | 0 {extras => demo/client/python}/test.py | 0 {tests => extras}/benchmark.php | 0 {tests => extras}/verify_compat.php | 0 src/Helper/Http.php | 2 +- tests/7DemofilesTest.php | 4 ++-- tests/8DebuggerTest.php | 4 ++-- tests/9ExtraFilesTest.php | 6 +++--- tests/{LocalFileTestCase.php => WebTestCase.php} | 16 ++++++++++------ tests/parse_args.php | 7 ++++--- 12 files changed, 26 insertions(+), 20 deletions(-) rename {extras => demo/client/perl}/test.pl (100%) rename {extras => demo/client/python}/test.py (100%) rename {tests => extras}/benchmark.php (100%) rename {tests => extras}/verify_compat.php (100%) rename tests/{LocalFileTestCase.php => WebTestCase.php} (88%) diff --git a/.travis.yml b/.travis.yml index 8dc6e60..90327cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,8 +53,8 @@ before_script: script: - ./vendor/bin/phpunit -v $PHPUNIT_OPTS tests - - python3 extras/test.py - - perl extras/test.pl + - python3 demo/client/python/test.py + - perl extras/client/perl/test.pl after_failure: # Troubleshoot test env build problems diff --git a/NEWS b/NEWS index 03222c8..8ac948f 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,8 @@ XML-RPC for PHP version 4.5.0 - 2020/12/31 * minor improvements in the debugger to allow easier integration of phpxmlrpc/jsonrpc and friends -* removed obsolete files from the 'extras' directory and updated the demo perl and python files +* removed obsolete files from the 'extras' folder; updated and moved to the 'demo' folders the perl and python + client scripts; moved benchmark.php and verify_compat.php to the 'extras' folder XML-RPC for PHP version 4.4.3 - 2020/12/17 diff --git a/extras/test.pl b/demo/client/perl/test.pl similarity index 100% rename from extras/test.pl rename to demo/client/perl/test.pl diff --git a/extras/test.py b/demo/client/python/test.py similarity index 100% rename from extras/test.py rename to demo/client/python/test.py diff --git a/tests/benchmark.php b/extras/benchmark.php similarity index 100% rename from tests/benchmark.php rename to extras/benchmark.php diff --git a/tests/verify_compat.php b/extras/verify_compat.php similarity index 100% rename from tests/verify_compat.php rename to extras/verify_compat.php diff --git a/src/Helper/Http.php b/src/Helper/Http.php index 10e4fed..d029a0e 100644 --- a/src/Helper/Http.php +++ b/src/Helper/Http.php @@ -105,7 +105,7 @@ class Http // server sent a Continue header without any (valid) content following... // give the client a chance to know it if (!$pos && !is_int($pos)) { - // works fine in php 3, 4 and 5 + /// @todo this construct works fine in php 3, 4 and 5 - 8; would it not be enough to have !== false now ? break; } diff --git a/tests/7DemofilesTest.php b/tests/7DemofilesTest.php index a769bf2..7c4b775 100644 --- a/tests/7DemofilesTest.php +++ b/tests/7DemofilesTest.php @@ -1,11 +1,11 @@ args = argParser::getArgs(); - $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/', $this->args['HTTPURI'] ); + $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/extras/', $this->args['HTTPURI'] ); $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); } diff --git a/tests/LocalFileTestCase.php b/tests/WebTestCase.php similarity index 88% rename from tests/LocalFileTestCase.php rename to tests/WebTestCase.php index 4062812..f4818b3 100644 --- a/tests/LocalFileTestCase.php +++ b/tests/WebTestCase.php @@ -6,10 +6,7 @@ include_once __DIR__ . '/PolyfillTestCase.php'; use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage; -/** - * @todo rename - */ -abstract class PhpXmlRpc_LocalFileTestCase extends PhpXmlRpc_PolyfillTestCase +abstract class PhpXmlRpc_WebTestCase extends PhpXmlRpc_PolyfillTestCase { public $args = array(); @@ -54,9 +51,16 @@ abstract class PhpXmlRpc_LocalFileTestCase extends PhpXmlRpc_PolyfillTestCase return $result; } - protected function request($file, $method = 'GET', $payload = '', $emptyPageOk = false) + /** + * @param string $path + * @param string $method + * @param string $payload + * @param false $emptyPageOk + * @return bool|string + */ + protected function request($path, $method = 'GET', $payload = '', $emptyPageOk = false) { - $url = $this->baseUrl . $file; + $url = $this->baseUrl . $path; $ch = curl_init($url); curl_setopt_array($ch, array( diff --git a/tests/parse_args.php b/tests/parse_args.php index d4e6624..6f22c94 100644 --- a/tests/parse_args.php +++ b/tests/parse_args.php @@ -72,17 +72,18 @@ class argParser if (!isset($HTTPURI) || $HTTPURI == '') { // GUESTIMATE the url of local demo server - // play nice to php 3 and 4-5 in retrieving URL of server.php + // play nice to php 4 and 5 in retrieving URL of server.php /// @todo filter out query string from REQUEST_URI + /// @todo review this code... if (isset($REQUEST_URI)) { $HTTPURI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $REQUEST_URI); $HTTPURI = str_replace('/testsuite.php', '/server.php', $HTTPURI); - $HTTPURI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $HTTPURI); + $HTTPURI = str_replace('/extras/benchmark.php', '/demo/server/server.php', $HTTPURI); $HTTPURI = str_replace('/benchmark.php', '/server.php', $HTTPURI); } elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['REQUEST_METHOD'])) { $HTTPURI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $_SERVER['PHP_SELF']); $HTTPURI = str_replace('/testsuite.php', '/server.php', $HTTPURI); - $HTTPURI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $HTTPURI); + $HTTPURI = str_replace('/extras/benchmark.php', '/demo/server/server.php', $HTTPURI); $HTTPURI = str_replace('/benchmark.php', '/server.php', $HTTPURI); } else { $HTTPURI = '/demo/server/server.php'; -- 2.43.0