Passed
Push — master ( ea57c6...209714 )
by Gaetano
07:44
created
tests/09HTTPTest.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/08ServerTest.php';
3
+include_once __DIR__.'/08ServerTest.php';
4 4
 
5 5
 /**
6 6
  * Tests which stress http features of the library.
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $methods = array();
36 36
         // as long as we are descendants, get_class_methods will list private/protected methods
37
-        foreach(get_class_methods('ServerTest') as $method)
37
+        foreach (get_class_methods('ServerTest') as $method)
38 38
         {
39 39
             if (strpos($method, 'test') === 0 && !in_array($method, $this->unsafeMethods))
40 40
             {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         // this checks for a non-failed call
149 149
         $time = microtime(true);
150 150
         $this->send($m);
151
-        $time = microtime(true) - $time;
151
+        $time = microtime(true)-$time;
152 152
         $this->assertGreaterThan(1.0, $time);
153 153
         $this->assertLessThan(2.0, $time);
154 154
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $m = new xmlrpcmsg('tests.sleep', array(new xmlrpcval(5, 'int')));
157 157
         $time = microtime(true);
158 158
         $r = $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail']));
159
-        $time = microtime(true) - $time;
159
+        $time = microtime(true)-$time;
160 160
         $this->assertGreaterThan(2.0, $time);
161 161
         $this->assertLessThan(4.0, $time);
162 162
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $this->addQueryParams(array('SLOW_LORIS' => 1));
177 177
         $time = microtime(true);
178 178
         $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail']));
179
-        $time = microtime(true) - $time;
179
+        $time = microtime(true)-$time;
180 180
         $this->assertGreaterThan(2.0, $time);
181 181
         $this->assertLessThan(4.0, $time);
182 182
     }
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                 preg_match('/ubunutu([0-9]+)/', $output[0], $matches);
356 356
                 $ubuntuVersion = @$matches[1];
357 357
             }
358
-            if ($ubuntuVersion >= 20 && $this->args['SSLVERSION'] != 6) {
358
+            if ($ubuntuVersion>=20 && $this->args['SSLVERSION'] != 6) {
359 359
                 $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher');
360 360
             }
361 361
         }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
             $this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_SOCKET_OPTS,
381 381
                 array('ssl' => array(
382 382
                     // security level is available as of php 7.2.0 + openssl 1.1.0 according to the docs
383
-                    'security_level' => min(1 + $version[1], 5),
383
+                    'security_level' => min(1+$version[1], 5),
384 384
                     // capture_session_meta was deprecated in php 7.0
385 385
                     //'capture_session_meta' => true,
386 386
                 ))
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
         if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0)
529 529
         {
530 530
             $version = explode('.', PHP_VERSION);
531
-            $this->client->setSSLVersion(min(4 + $version[1], 7));
531
+            $this->client->setSSLVersion(min(4+$version[1], 7));
532 532
         }
533 533
 
534 534
         $this->$method();
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -304,8 +304,7 @@  discard block
 block discarded – undo
304 304
         if (!function_exists('curl_init'))
305 305
         {
306 306
             $this->markTestSkipped('CURL missing: cannot test https functionality');
307
-        }
308
-        else if ($this->args['HTTPSSERVER'] == '')
307
+        } else if ($this->args['HTTPSSERVER'] == '')
309 308
         {
310 309
             $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https');
311 310
         }
@@ -480,8 +479,7 @@  discard block
 block discarded – undo
480 479
         if (!function_exists('curl_init'))
481 480
         {
482 481
             $this->markTestSkipped('CURL missing: cannot test http 1.1 w. proxy');
483
-        }
484
-        else if ($this->args['PROXYSERVER'] == '')
482
+        } else if ($this->args['PROXYSERVER'] == '')
485 483
         {
486 484
             $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. http 1.1');
487 485
         }
@@ -505,12 +503,10 @@  discard block
 block discarded – undo
505 503
         if (!function_exists('curl_init'))
506 504
         {
507 505
             $this->markTestSkipped('CURL missing: cannot test https w. proxy');
508
-        }
509
-        else if ($this->args['PROXYSERVER'] == '')
506
+        } else if ($this->args['PROXYSERVER'] == '')
510 507
         {
511 508
             $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. https');
512
-        }
513
-        else if ($this->args['HTTPSSERVER'] == '')
509
+        } else if ($this->args['HTTPSSERVER'] == '')
514 510
         {
515 511
             $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https w. proxy');
516 512
         }
Please login to merge, or discard this patch.