Tests
authorgggeek <giunta.gaetano@gmail.com>
Thu, 10 Dec 2020 17:22:35 +0000 (17:22 +0000)
committergggeek <giunta.gaetano@gmail.com>
Thu, 10 Dec 2020 17:22:35 +0000 (17:22 +0000)
.travis.yml
tests/1ParsingBugsTest.php
tests/3LocalhostTest.php
tests/4LocalhostMultiTest.php
tests/5DemofilesTest.php
tests/LocalFileTestCase.php
tests/parse_args.php

index e9d8fe4..c270357 100644 (file)
@@ -11,7 +11,7 @@ env:
         - URI=/demo/server/server.php
         - HTTPSSERVER=localhost
         - HTTPSURI=/demo/server/server.php
-        - PROXY=localhost:8080
+        - PROXYSERVER=localhost:8080
         # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
         # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
         - HTTPSVERIFYHOST=0
index 4a9f23a..09d8b2f 100644 (file)
@@ -161,7 +161,7 @@ class ParsingBugsTests extends PhpXmlRpc_PolyfillTestCase
     public function testI8()
     {
         if (PHP_INT_SIZE == 4 ) {
-            $this->markTestSkipped('did not find a locale which sets decimal separator to comma');
+            $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode');
             return;
         }
 
index 85934d4..9cbd1fd 100644 (file)
@@ -969,7 +969,7 @@ And turned it into nylon';
             new xmlrpcval('hello world', 'string'),
         ));
         $r = $this->send($m, 0, true);
-        $this->assertContains('hello world', $r->raw_data);
+        $this->assertStringContainsString('hello world', $r->raw_data);
     }
 
     public function testSendTwiceSameMsg()
index 0516c30..317e517 100644 (file)
@@ -103,7 +103,7 @@ class LocalhostMultiTest extends LocalhostTest
     {
         if ($this->args['PROXYSERVER'] == '')
         {
-            $this->markTestSkipped('PROXY definition missing: cannot test proxy');
+            $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy');
             return;
         }
 
@@ -204,7 +204,7 @@ class LocalhostMultiTest extends LocalhostTest
         }
         else if ($this->args['PROXYSERVER'] == '')
         {
-            $this->markTestSkipped('PROXY definition missing: cannot test proxy w. http 1.1');
+            $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. http 1.1');
             return;
         }
 
@@ -281,7 +281,7 @@ class LocalhostMultiTest extends LocalhostTest
         }
         else if ($this->args['PROXYSERVER'] == '')
         {
-            $this->markTestSkipped('PROXY definition missing: cannot test proxy w. https');
+            $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. https');
             return;
         }
         else if ($this->args['HTTPSSERVER'] == '')
index 4ee62c8..e064add 100644 (file)
@@ -63,14 +63,14 @@ class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase
     public function testDiscussServer()
     {
         $page = $this->request('server/discuss.php');
-        $this->assertContains('<name>faultCode</name>', $page);
+        $this->assertStringContainsString('<name>faultCode</name>', $page);
         $this->assertRegexp('#<int>10(5|3)</int>#', $page);
     }
 
     public function testProxyServer()
     {
         $page = $this->request('server/proxy.php');
-        $this->assertContains('<name>faultCode</name>', $page);
+        $this->assertStringContainsString('<name>faultCode</name>', $page);
         $this->assertRegexp('#<int>10(5|3)</int>#', $page);
     }
 }
index 255a87b..6ec48b3 100644 (file)
@@ -75,8 +75,8 @@ abstract class PhpXmlRpc_LocalFileTestCase extends PhpXmlRpc_PolyfillTestCase
         if (!$emptyPageOk) {
             $this->assertNotEquals('', $page);
         }
-        $this->assertNotContains('Fatal error', $page);
-        $this->assertNotContains('Notice:', $page);
+        $this->assertStringNotContainsStringIgnoringCase('Fatal error', $page);
+        $this->assertStringNotContainsStringIgnoringCase('Notice:', $page);
 
         return $page;
     }
index d9b3d5a..4ef568d 100644 (file)
@@ -21,8 +21,6 @@ class argParser
 {
     public static function getArgs()
     {
-        global $argv;
-
         $args = array(
             'DEBUG' => 0,
             'LOCALSERVER' => 'localhost',
@@ -32,7 +30,7 @@ class argParser
             'HTTPSVERIFYHOST' => 2,
             'SSLVERSION' => 0,
             'PROXYSERVER' => null,
-            'NOPROXY' => false,
+            //'NOPROXY' => false,
             'LOCALPATH' => __DIR__,
         );
 
@@ -76,8 +74,8 @@ class argParser
         if (isset($SSLVERSION)) {
             $args['SSLVERSION'] = (int)$SSLVERSION;
         }
-        if (isset($PROXY)) {
-            $arr = explode(':', $PROXY);
+        if (isset($PROXYSERVER)) {
+            $arr = explode(':', $PROXYSERVER);
             $args['PROXYSERVER'] = $arr[0];
             if (count($arr) > 1) {
                 $args['PROXYPORT'] = $arr[1];
@@ -86,9 +84,9 @@ class argParser
             }
         }
         // used to silence testsuite warnings about proxy code not being tested
-        if (isset($NOPROXY)) {
-            $args['NOPROXY'] = true;
-        }
+        //if (isset($NOPROXY)) {
+        //    $args['NOPROXY'] = true;
+        //}
         if (!isset($URI)) {
             // GUESTIMATE the url of local demo server
             // play nice to php 3 and 4-5 in retrieving URL of server.php