@@ -1,6 +1,6 @@ discard block |
||
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. |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | $methods = array(); |
30 | 30 | // as long as we are descendants, get_class_methods will list private/protected methods |
31 | - foreach(get_class_methods('ServerTest') as $method) |
|
31 | + foreach (get_class_methods('ServerTest') as $method) |
|
32 | 32 | { |
33 | 33 | if (strpos($method, 'test') === 0 && !in_array($method, $this->unsafeMethods)) |
34 | 34 | { |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0) |
297 | 297 | { |
298 | 298 | $version = explode('.', PHP_VERSION); |
299 | - $this->client->setSSLVersion(min(4 + $version[1], 7)); |
|
299 | + $this->client->setSSLVersion(min(4+$version[1], 7)); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | $this->$method(); |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | preg_match('/ubunutu([0-9]+)/', $output[0], $matches); |
329 | 329 | $ubuntuVersion = @$matches[1]; |
330 | 330 | } |
331 | - if ($ubuntuVersion >= 20) { |
|
331 | + if ($ubuntuVersion>=20) { |
|
332 | 332 | $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher'); |
333 | 333 | return; |
334 | 334 | } |
@@ -349,12 +349,12 @@ discard block |
||
349 | 349 | $version = explode('.', PHP_VERSION); |
350 | 350 | /// @see https://docs.openssl.org/1.1.1/man3/SSL_CTX_set_security_level/#default-callback-behaviour for levels |
351 | 351 | $this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_SOCKET_OPTS, |
352 | - array('ssl' => array('security_level' => min(2 + $version[1], 5)))); |
|
352 | + array('ssl' => array('security_level' => min(2+$version[1], 5)))); |
|
353 | 353 | /// @todo we should probably look deeper into the Apache config / ssl version in use to find out why this |
354 | 354 | /// does not work well with TLS < 1.2. |
355 | 355 | /// Also: push this IF to the test matrix config, leave here only setting of security_level |
356 | 356 | if ($this->args['SSLVERSION'] == 0) { |
357 | - $this->client->setSSLVersion(min(5 + $version[1], 7)); |
|
357 | + $this->client->setSSLVersion(min(5+$version[1], 7)); |
|
358 | 358 | } |
359 | 359 | } |
360 | 360 | $this->$method(); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0) |
395 | 395 | { |
396 | 396 | $version = explode('.', PHP_VERSION); |
397 | - $this->client->setSSLVersion(min(4 + $version[1], 7)); |
|
397 | + $this->client->setSSLVersion(min(4+$version[1], 7)); |
|
398 | 398 | } |
399 | 399 | |
400 | 400 | $this->$method(); |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | // this checks for a non-failed call |
555 | 555 | $time = microtime(true); |
556 | 556 | $this->send($m); |
557 | - $time = microtime(true) - $time; |
|
557 | + $time = microtime(true)-$time; |
|
558 | 558 | $this->assertGreaterThan(1.0, $time); |
559 | 559 | $this->assertLessThan(2.0, $time); |
560 | 560 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | $m = new xmlrpcmsg('tests.sleep', array(new xmlrpcval(5, 'int'))); |
563 | 563 | $time = microtime(true); |
564 | 564 | $r = $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail'])); |
565 | - $time = microtime(true) - $time; |
|
565 | + $time = microtime(true)-$time; |
|
566 | 566 | $this->assertGreaterThan(2.0, $time); |
567 | 567 | $this->assertLessThan(4.0, $time); |
568 | 568 | |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | $this->addQueryParams(array('SLOW_LORIS' => 1)); |
583 | 583 | $time = microtime(true); |
584 | 584 | $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail'])); |
585 | - $time = microtime(true) - $time; |
|
585 | + $time = microtime(true)-$time; |
|
586 | 586 | $this->assertGreaterThan(2.0, $time); |
587 | 587 | $this->assertLessThan(4.0, $time); |
588 | 588 | } |