whitespace; comments
authorgggeek <giunta.gaetano@gmail.com>
Sun, 8 Jan 2023 16:30:19 +0000 (16:30 +0000)
committergggeek <giunta.gaetano@gmail.com>
Sun, 8 Jan 2023 16:30:19 +0000 (16:30 +0000)
extras/verify_compat.php
tests/4ClientTest.php
tests/5ServerTest.php
tests/index.php
tests/parse_args.php
tests/phpunit_coverage.php

index c8ef34d..9157a56 100644 (file)
@@ -7,6 +7,9 @@
  * @license code licensed under the BSD License: see file license.txt
  *
  * @todo add a test for php output buffering?
+ * @todo check for presence of specific curl options, such as fe. the HTTP2 ones
+ * @todo check for presence of mbstring
+ * @todo check for presence of the xmlrpc extension
  */
 
 function phpxmlrpc_verify_compat($mode = 'client')
@@ -108,44 +111,36 @@ function phpxmlrpc_verify_compat($mode = 'client')
             font-family: Arial, Verdana, Geneva, sans-serif;
             font-size: small;
         }
-
         table {
             border: 1px solid gray;
             padding: 0;
         }
-
         thead {
             background-color: silver;
             color: black;
         }
-
         td {
             margin: 0;
             padding: 0.5em;
         }
-
         tbody td {
             border-top: 1px solid gray;
         }
-
         .res0 {
             background-color: red;
             color: black;
             border-right: 1px solid gray;
         }
-
         .res1 {
             background-color: yellow;
             color: black;
             border-right: 1px solid gray;
         }
-
         .res2 {
             background-color: green;
             color: black;
             border-right: 1px solid gray;
         }
-
         .result {
             white-space: pre;
         }
index f2f5627..a2942b4 100644 (file)
@@ -89,7 +89,6 @@ class ClientTest extends PhpXmlRpc_PolyfillTestCase
             $this->client->port = $server[1];
         }
         $this->client->server = $server[0];
-        //$this->client->path = str_replace('/demo/server/server.php', '/tests/index.php?demo=server/server.php', $this->args['HTTPURI']);
         $this->client->path = $this->args['HTTPURI'];
 
         $r = $this->client->send($m, 5, 'http11');
index 8ba0d53..23e8094 100644 (file)
@@ -95,7 +95,6 @@ class ServerTest extends PhpXmlRpc_PolyfillTestCase
     {
         $this->args = argParser::getArgs();
 
-        //$uri = str_replace('/demo/server/server.php', '/tests/index.php?demo=server/server.php', $this->args['HTTPURI']);
         $server = explode(':', $this->args['HTTPSERVER']);
         if (count($server) > 1) {
             $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]);
index a14defa..c1d63a2 100644 (file)
@@ -1,17 +1,20 @@
 <?php
 
-// File accessed by http requests as part of the test suite, enabling testing of demo, debugger, extras files.
-// It triggers generation of code-coverage information
+// File accessed by http requests sent by the test suite, enabling testing of demo, debugger, extras files.
+// It makes all errors visible, triggers generation of code-coverage information, and runs the target file,
+// which is specified as GET param.
 
 // Make errors visible
 ini_set('display_errors', true);
 error_reporting(E_ALL);
 
-// Set up a constant which can be used by demo code to tell if the testuite is in action
+// Set up a constant which can be used by demo code to tell if the testuite is in action.
+// We use a constant because it can not be injected via GET/POST/COOKIE/ENV
 const TESTMODE = true;
 
 // Out-of-band information: let the client manipulate the page operations
 if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) {
+    // NB: this has to be kept in sync with phunit_coverage.php
     $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage';
     if (!is_dir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'])) {
         mkdir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']);
index 7359353..0fe331e 100644 (file)
@@ -43,7 +43,8 @@ class argParser
             //'LOCALPATH' => __DIR__,
         );
 
-        // check for command line (env vars) vs. web page input params
+        // check for command line params (passed as env vars) vs. web page input params (passed as GET/POST)
+        // Note that the only usecase for web-page mode is when this is used by benchmark.php
         if (!isset($_SERVER['REQUEST_METHOD'])) {
             foreach($_SERVER as $key => $val) {
                 if (array_key_exists($key, $args)) {
index 75941e9..f49f7c7 100644 (file)
@@ -8,7 +8,7 @@
 
 $coverageFile = realpath(__DIR__ . "/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php");
 
-// has to be the same value as used in server.php
+// has to be the same value as used in index.php
 $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage';
 
 if (!is_dir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'])) {