@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer |
| 17 | -include_once __DIR__ . '/../../src/Autoloader.php'; |
|
| 17 | +include_once __DIR__.'/../../src/Autoloader.php'; |
|
| 18 | 18 | PhpXmlRpc\Autoloader::register(); |
| 19 | 19 | |
| 20 | 20 | // Out-of-band information: let the client manipulate the server operations. |
@@ -26,5 +26,5 @@ discard block |
||
| 26 | 26 | chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
| 29 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
| 30 | 30 | } |
@@ -3,5 +3,5 @@ |
||
| 3 | 3 | // Out-of-band information: let the client manipulate the server operations. |
| 4 | 4 | // We do this to help the testsuite script: do not reproduce in production! |
| 5 | 5 | if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) { |
| 6 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
| 6 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
| 7 | 7 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | error_reporting(E_ALL); |
| 15 | 15 | |
| 16 | 16 | // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer |
| 17 | -include_once __DIR__ . '/../../src/Autoloader.php'; |
|
| 17 | +include_once __DIR__.'/../../src/Autoloader.php'; |
|
| 18 | 18 | PhpXmlRpc\Autoloader::register(); |
| 19 | 19 | |
| 20 | 20 | // Let unit tests run against localhost, 'plain' demos against a known public server |
@@ -33,5 +33,5 @@ discard block |
||
| 33 | 33 | chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
| 36 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
| 37 | 37 | } |
@@ -2,12 +2,12 @@ discard block |
||
| 2 | 2 | /** |
| 3 | 3 | * NB: do not let your IDE fool you. The correct encoding for this file is NOT UTF8. |
| 4 | 4 | */ |
| 5 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; |
|
| 6 | -include_once __DIR__ . '/../lib/xmlrpcs.inc'; |
|
| 5 | +include_once __DIR__.'/../lib/xmlrpc.inc'; |
|
| 6 | +include_once __DIR__.'/../lib/xmlrpcs.inc'; |
|
| 7 | 7 | |
| 8 | -include_once __DIR__ . '/parse_args.php'; |
|
| 8 | +include_once __DIR__.'/parse_args.php'; |
|
| 9 | 9 | |
| 10 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
| 10 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
| 11 | 11 | |
| 12 | 12 | use PHPUnit\Runner\BaseTestRunner; |
| 13 | 13 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function testUnicodeInMemberName() |
| 67 | 67 | { |
| 68 | - $str = "G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
| 68 | + $str = "G".chr(252)."nter, El".chr(232)."ne"; |
|
| 69 | 69 | $v = array($str => new xmlrpcval(1)); |
| 70 | 70 | $r = new xmlrpcresp(new xmlrpcval($v, 'struct')); |
| 71 | 71 | $r = $r->serialize(); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | '<?xml version="1.0"?> |
| 82 | 82 | <!-- $Id --> |
| 83 | 83 | <!-- found by G. Giunta, covers what happens when lib receives UTF8 chars in response text and comments --> |
| 84 | -<!-- ' . chr(224) . chr(252) . chr(232) . 'àüè --> |
|
| 84 | +<!-- ' . chr(224).chr(252).chr(232).'àüè --> |
|
| 85 | 85 | <methodResponse> |
| 86 | 86 | <fault> |
| 87 | 87 | <value> |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | </member> |
| 93 | 93 | <member> |
| 94 | 94 | <name>faultString</name> |
| 95 | -<value><string>' . chr(224) . chr(252) . chr(232) . 'àüè</string></value> |
|
| 95 | +<value><string>' . chr(224).chr(252).chr(232).'àüè</string></value> |
|
| 96 | 96 | </member> |
| 97 | 97 | </struct> |
| 98 | 98 | </value> |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $m = $this->newMsg('dummy'); |
| 102 | 102 | $r = $m->parseResponse($response); |
| 103 | 103 | $v = $r->faultString(); |
| 104 | - $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v); |
|
| 104 | + $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | public function testValidNumbers() |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | public function testI8() |
| 164 | 164 | { |
| 165 | - if (PHP_INT_SIZE == 4 ) { |
|
| 165 | + if (PHP_INT_SIZE == 4) { |
|
| 166 | 166 | $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode'); |
| 167 | 167 | return; |
| 168 | 168 | } |
@@ -485,11 +485,11 @@ discard block |
||
| 485 | 485 | |
| 486 | 486 | public function testUTF8Response() |
| 487 | 487 | { |
| 488 | - $string = chr(224) . chr(252) . chr(232); |
|
| 488 | + $string = chr(224).chr(252).chr(232); |
|
| 489 | 489 | |
| 490 | 490 | $s = $this->newMsg('dummy'); |
| 491 | - $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
| 492 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 491 | + $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
| 492 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 493 | 493 | '; |
| 494 | 494 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 495 | 495 | $v = $r->value(); |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $this->assertEquals($string, $v); |
| 498 | 498 | |
| 499 | 499 | $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
| 500 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 500 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 501 | 501 | '; |
| 502 | 502 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 503 | 503 | $v = $r->value(); |
@@ -512,11 +512,11 @@ discard block |
||
| 512 | 512 | |
| 513 | 513 | public function testLatin1Response() |
| 514 | 514 | { |
| 515 | - $string = chr(224) . chr(252) . chr(232); |
|
| 515 | + $string = chr(224).chr(252).chr(232); |
|
| 516 | 516 | |
| 517 | 517 | $s = $this->newMsg('dummy'); |
| 518 | - $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
| 519 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 518 | + $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
| 519 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 520 | 520 | '; |
| 521 | 521 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 522 | 522 | $v = $r->value(); |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | $this->assertEquals($string, $v); |
| 525 | 525 | |
| 526 | 526 | $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
| 527 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 527 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
| 528 | 528 | '; |
| 529 | 529 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 530 | 530 | $v = $r->value(); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | $this->assertequals(1, count($v1)); |
| 620 | 620 | $out = array('me' => array(), 'mytype' => 2, '_php_class' => null); |
| 621 | 621 | |
| 622 | - foreach($v1 as $key => $val) |
|
| 622 | + foreach ($v1 as $key => $val) |
|
| 623 | 623 | { |
| 624 | 624 | $this->assertArrayHasKey($key, $out); |
| 625 | 625 | $expected = $out[$key]; |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | $this->assertequals(2, count($v2)); |
| 635 | 635 | $out = array(array('key' => 0, 'value' => 'object'), array('key' => 1, 'value' => 'object')); |
| 636 | 636 | $i = 0; |
| 637 | - foreach($v2 as $key => $val) |
|
| 637 | + foreach ($v2 as $key => $val) |
|
| 638 | 638 | { |
| 639 | 639 | $expected = $out[$i]; |
| 640 | 640 | $this->assertequals($expected['key'], $key); |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | { |
| 648 | 648 | // nb: make sure that the serialized xml corresponding to this is > 10MB in size |
| 649 | 649 | $data = array(); |
| 650 | - for ($i = 0; $i < 500000; $i++ ) { |
|
| 650 | + for ($i = 0; $i<500000; $i++) { |
|
| 651 | 651 | $data[] = 'hello world'; |
| 652 | 652 | } |
| 653 | 653 | |
@@ -21,14 +21,16 @@ |
||
| 21 | 21 | protected function set_up() |
| 22 | 22 | { |
| 23 | 23 | $this->args = argParser::getArgs(); |
| 24 | - if ($this->args['DEBUG'] == 1) |
|
| 25 | - ob_start(); |
|
| 24 | + if ($this->args['DEBUG'] == 1) { |
|
| 25 | + ob_start(); |
|
| 26 | + } |
|
| 26 | 27 | } |
| 27 | 28 | |
| 28 | 29 | protected function tear_down() |
| 29 | 30 | { |
| 30 | - if ($this->args['DEBUG'] != 1) |
|
| 31 | - return; |
|
| 31 | + if ($this->args['DEBUG'] != 1) { |
|
| 32 | + return; |
|
| 33 | + } |
|
| 32 | 34 | $out = ob_get_clean(); |
| 33 | 35 | $status = $this->getStatus(); |
| 34 | 36 | if ($status == BaseTestRunner::STATUS_ERROR |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/parse_args.php'; |
|
| 3 | +include_once __DIR__.'/parse_args.php'; |
|
| 4 | 4 | |
| 5 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
| 5 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
| 6 | 6 | |
| 7 | 7 | use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage; |
| 8 | 8 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function _run($result = NULL) |
| 30 | 30 | { |
| 31 | - $this->testId = get_class($this) . '__' . $this->getName(); |
|
| 31 | + $this->testId = get_class($this).'__'.$this->getName(); |
|
| 32 | 32 | |
| 33 | 33 | if ($result === NULL) { |
| 34 | 34 | $result = $this->createResult(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | protected function request($file, $method = 'GET', $payload = '', $emptyPageOk = false) |
| 58 | 58 | { |
| 59 | - $url = $this->baseUrl . $file; |
|
| 59 | + $url = $this->baseUrl.$file; |
|
| 60 | 60 | |
| 61 | 61 | $ch = curl_init($url); |
| 62 | 62 | curl_setopt_array($ch, array( |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | curl_setopt($ch, CURLOPT_COOKIE, 'PHPUNIT_SELENIUM_TEST_ID='.$this->testId); |
| 76 | 76 | } |
| 77 | - if ($this->args['DEBUG'] > 0) { |
|
| 77 | + if ($this->args['DEBUG']>0) { |
|
| 78 | 78 | curl_setopt($ch, CURLOPT_VERBOSE, 1); |
| 79 | 79 | } |
| 80 | 80 | $page = curl_exec($ch); |
@@ -2,20 +2,20 @@ |
||
| 2 | 2 | |
| 3 | 3 | use PHPUnit\Runner\Version as PHPUnit_Version; |
| 4 | 4 | |
| 5 | -if ( class_exists( 'PHPUnit_Extensions_SeleniumCommon_RemoteCoverage' ) === true |
|
| 6 | - && class_exists( 'PHPUnit\Extensions\SeleniumCommon\RemoteCoverage' ) === false |
|
| 5 | +if (class_exists('PHPUnit_Extensions_SeleniumCommon_RemoteCoverage') === true |
|
| 6 | + && class_exists('PHPUnit\Extensions\SeleniumCommon\RemoteCoverage') === false |
|
| 7 | 7 | ) { |
| 8 | - class_alias( 'PHPUnit_Extensions_SeleniumCommon_RemoteCoverage', 'PHPUnit\Extensions\SeleniumCommon\RemoteCoverage' ); |
|
| 8 | + class_alias('PHPUnit_Extensions_SeleniumCommon_RemoteCoverage', 'PHPUnit\Extensions\SeleniumCommon\RemoteCoverage'); |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | -if ( class_exists( 'PHPUnit_Runner_BaseTestRunner' ) === true |
|
| 12 | - && class_exists( 'PHPUnit\Runner\BaseTestRunner' ) === false |
|
| 11 | +if (class_exists('PHPUnit_Runner_BaseTestRunner') === true |
|
| 12 | + && class_exists('PHPUnit\Runner\BaseTestRunner') === false |
|
| 13 | 13 | ) { |
| 14 | - class_alias( 'PHPUnit_Runner_BaseTestRunner', 'PHPUnit\Runner\BaseTestRunner' ); |
|
| 14 | + class_alias('PHPUnit_Runner_BaseTestRunner', 'PHPUnit\Runner\BaseTestRunner'); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | if (class_exists(PHPUnit_Version::class) === false || version_compare(PHPUnit_Version::id(), '8.0.0', '<')) { |
| 18 | - include_once __DIR__ . '/PolyfillTestCase7.php'; |
|
| 18 | + include_once __DIR__.'/PolyfillTestCase7.php'; |
|
| 19 | 19 | } else { |
| 20 | - include_once __DIR__ . '/PolyfillTestCase8.php'; |
|
| 20 | + include_once __DIR__.'/PolyfillTestCase8.php'; |
|
| 21 | 21 | } |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; |
|
| 4 | -include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc'; |
|
| 3 | +include_once __DIR__.'/../lib/xmlrpc.inc'; |
|
| 4 | +include_once __DIR__.'/../lib/xmlrpc_wrappers.inc'; |
|
| 5 | 5 | |
| 6 | -include_once __DIR__ . '/parse_args.php'; |
|
| 6 | +include_once __DIR__.'/parse_args.php'; |
|
| 7 | 7 | |
| 8 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
| 8 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
| 9 | 9 | |
| 10 | 10 | use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage; |
| 11 | 11 | use PHPUnit\Framework\TestResult; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | // (but only if not called from subclass objects / multitests) |
| 42 | 42 | if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') { |
| 43 | 43 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
| 44 | - for ($i = 0; $i < count($trace); $i++) { |
|
| 44 | + for ($i = 0; $i<count($trace); $i++) { |
|
| 45 | 45 | if (strpos($trace[$i]['function'], 'test') === 0) { |
| 46 | 46 | self::$failed_tests[$trace[$i]['function']] = true; |
| 47 | 47 | break; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function _run($result = NULL) |
| 66 | 66 | { |
| 67 | - $this->testId = get_class($this) . '__' . $this->getName(); |
|
| 67 | + $this->testId = get_class($this).'__'.$this->getName(); |
|
| 68 | 68 | |
| 69 | 69 | if ($result === NULL) { |
| 70 | 70 | $result = $this->createResult(); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $this->args = argParser::getArgs(); |
| 96 | 96 | |
| 97 | 97 | $server = explode(':', $this->args['HTTPSERVER']); |
| 98 | - if (count($server) > 1) { |
|
| 98 | + if (count($server)>1) { |
|
| 99 | 99 | $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]); |
| 100 | 100 | } else { |
| 101 | 101 | $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $this->client->request_compression = $this->request_compression; |
| 106 | 106 | $this->client->accepted_compression = $this->accepted_compression; |
| 107 | 107 | |
| 108 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
|
| 108 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
| 109 | 109 | |
| 110 | 110 | if ($this->args['DEBUG'] == 1) |
| 111 | 111 | ob_start(); |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | return $r; |
| 142 | 142 | } |
| 143 | 143 | if (is_array($errorCode)) { |
| 144 | - $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 144 | + $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 145 | 145 | } else { |
| 146 | - $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 146 | + $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 147 | 147 | } |
| 148 | 148 | if (!$r->faultCode()) { |
| 149 | 149 | if ($returnResponse) { |
@@ -165,20 +165,20 @@ discard block |
||
| 165 | 165 | $query = parse_url($this->client->path, PHP_URL_QUERY); |
| 166 | 166 | parse_str($query, $vars); |
| 167 | 167 | $query = http_build_query(array_merge($vars, $data)); |
| 168 | - $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query; |
|
| 168 | + $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | public function testString() |
| 172 | 172 | { |
| 173 | - $sendString = "here are 3 \"entities\": < > & " . |
|
| 174 | - "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . |
|
| 175 | - " - isn't that great? \\\"hackery\\\" at it's best " . |
|
| 176 | - " also don't want to miss out on \$item[0]. " . |
|
| 177 | - "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . |
|
| 178 | - "a simple CR here" . chr(13) . |
|
| 179 | - "a simple LF here" . chr(10) . |
|
| 180 | - "and then LFCR" . chr(10) . chr(13) . |
|
| 181 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; |
|
| 173 | + $sendString = "here are 3 \"entities\": < > & ". |
|
| 174 | + "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92). |
|
| 175 | + " - isn't that great? \\\"hackery\\\" at it's best ". |
|
| 176 | + " also don't want to miss out on \$item[0]. ". |
|
| 177 | + "The real weird stuff follows: CRLF here".chr(13).chr(10). |
|
| 178 | + "a simple CR here".chr(13). |
|
| 179 | + "a simple LF here".chr(10). |
|
| 180 | + "and then LFCR".chr(10).chr(13). |
|
| 181 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; |
|
| 182 | 182 | $m = new xmlrpcmsg('examples.stringecho', array( |
| 183 | 183 | new xmlrpcval($sendString, 'string'), |
| 184 | 184 | )); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | public function testLatin1String() |
| 200 | 200 | { |
| 201 | 201 | $sendString = |
| 202 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
| 202 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne"; |
|
| 203 | 203 | $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'. |
| 204 | 204 | $sendString. |
| 205 | 205 | '</value></param></params></methodCall>'; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | public function testUtf8Method() |
| 304 | 304 | { |
| 305 | 305 | PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8'; |
| 306 | - $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array( |
|
| 306 | + $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array( |
|
| 307 | 307 | new xmlrpcval('hello') |
| 308 | 308 | )); |
| 309 | 309 | $v = $this->send($m); |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | )); |
| 326 | 326 | $v = $this->send($m); |
| 327 | 327 | if ($v) { |
| 328 | - $this->assertEquals($a + $b, $v->scalarval()); |
|
| 328 | + $this->assertEquals($a+$b, $v->scalarval()); |
|
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | )); |
| 338 | 338 | $v = $this->send($m); |
| 339 | 339 | if ($v) { |
| 340 | - $this->assertEquals(12 - 23, $v->scalarval()); |
|
| 340 | + $this->assertEquals(12-23, $v->scalarval()); |
|
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | if ($v) { |
| 372 | 372 | $sz = $v->arraysize(); |
| 373 | 373 | $got = ''; |
| 374 | - for ($i = 0; $i < $sz; $i++) { |
|
| 374 | + for ($i = 0; $i<$sz; $i++) { |
|
| 375 | 375 | $b = $v->arraymem($i); |
| 376 | 376 | if ($b->scalarval()) { |
| 377 | 377 | $got .= '1'; |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | $got = ''; |
| 435 | 435 | $expected = '37210'; |
| 436 | 436 | $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes'); |
| 437 | - foreach($expect_array as $val) { |
|
| 437 | + foreach ($expect_array as $val) { |
|
| 438 | 438 | $b = $v->structmem($val); |
| 439 | 439 | $got .= $b->me['int']; |
| 440 | 440 | } |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | { |
| 864 | 864 | // make a 'deep client copy' as the original one might have many properties set |
| 865 | 865 | // also for speed only wrap one method of the whole server |
| 866 | - $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' )); |
|
| 866 | + $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/')); |
|
| 867 | 867 | if ($class == '') { |
| 868 | 868 | $this->fail('Registration of remote server failed'); |
| 869 | 869 | } else { |
@@ -902,9 +902,9 @@ discard block |
||
| 902 | 902 | $cookies = array( |
| 903 | 903 | //'c1' => array(), |
| 904 | 904 | 'c2' => array('value' => 'c2'), |
| 905 | - 'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30), |
|
| 906 | - 'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'), |
|
| 907 | - 'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
| 905 | + 'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30), |
|
| 906 | + 'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'), |
|
| 907 | + 'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
| 908 | 908 | ); |
| 909 | 909 | $cookiesval = php_xmlrpc_encode($cookies); |
| 910 | 910 | $m = new xmlrpcmsg('examples.setcookies', array($cookiesval)); |
@@ -952,10 +952,10 @@ discard block |
||
| 952 | 952 | $m = new xmlrpcmsg('examples.getcookies', array()); |
| 953 | 953 | foreach ($cookies as $cookie => $val) { |
| 954 | 954 | $this->client->setCookie($cookie, $val); |
| 955 | - $cookies[$cookie] = (string)$cookies[$cookie]; |
|
| 955 | + $cookies[$cookie] = (string) $cookies[$cookie]; |
|
| 956 | 956 | } |
| 957 | 957 | $r = $this->client->send($m, $this->timeout, $this->method); |
| 958 | - $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 958 | + $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 959 | 959 | if (!$r->faultCode()) { |
| 960 | 960 | $v = $r->value(); |
| 961 | 961 | $v = php_xmlrpc_decode($v); |
@@ -107,14 +107,16 @@ |
||
| 107 | 107 | |
| 108 | 108 | $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
| 109 | 109 | |
| 110 | - if ($this->args['DEBUG'] == 1) |
|
| 111 | - ob_start(); |
|
| 110 | + if ($this->args['DEBUG'] == 1) { |
|
| 111 | + ob_start(); |
|
| 112 | + } |
|
| 112 | 113 | } |
| 113 | 114 | |
| 114 | 115 | protected function tear_down() |
| 115 | 116 | { |
| 116 | - if ($this->args['DEBUG'] != 1) |
|
| 117 | - return; |
|
| 117 | + if ($this->args['DEBUG'] != 1) { |
|
| 118 | + return; |
|
| 119 | + } |
|
| 118 | 120 | $out = ob_get_clean(); |
| 119 | 121 | $status = $this->getStatus(); |
| 120 | 122 | if ($status == BaseTestRunner::STATUS_ERROR |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; |
|
| 3 | +include_once __DIR__.'/../lib/xmlrpc.inc'; |
|
| 4 | 4 | |
| 5 | -include_once __DIR__ . '/parse_args.php'; |
|
| 5 | +include_once __DIR__.'/parse_args.php'; |
|
| 6 | 6 | |
| 7 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
| 7 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
| 8 | 8 | |
| 9 | 9 | use PHPUnit\Runner\BaseTestRunner; |
| 10 | 10 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | // make sure there's no freaking catchall DNS in effect |
| 60 | 60 | $dnsinfo = dns_get_record($this->client->server); |
| 61 | 61 | if ($dnsinfo) { |
| 62 | - $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found'); |
|
| 62 | + $this->markTestSkipped('Seems like there is a catchall DNS in effect: host '.$this->client->server.' found'); |
|
| 63 | 63 | } else { |
| 64 | 64 | $this->assertEquals(5, $r->faultCode()); |
| 65 | 65 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | // now test a successful connection |
| 86 | 86 | $server = explode(':', $this->args['HTTPSERVER']); |
| 87 | - if (count($server) > 1) { |
|
| 87 | + if (count($server)>1) { |
|
| 88 | 88 | $this->client->port = $server[1]; |
| 89 | 89 | } |
| 90 | 90 | $this->client->server = $server[0]; |
@@ -24,14 +24,16 @@ |
||
| 24 | 24 | $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['HTTPSERVER'], 80); |
| 25 | 25 | $this->client->setDebug($this->args['DEBUG']); |
| 26 | 26 | |
| 27 | - if ($this->args['DEBUG'] == 1) |
|
| 28 | - ob_start(); |
|
| 27 | + if ($this->args['DEBUG'] == 1) { |
|
| 28 | + ob_start(); |
|
| 29 | + } |
|
| 29 | 30 | } |
| 30 | 31 | |
| 31 | 32 | protected function tear_down() |
| 32 | 33 | { |
| 33 | - if ($this->args['DEBUG'] != 1) |
|
| 34 | - return; |
|
| 34 | + if ($this->args['DEBUG'] != 1) { |
|
| 35 | + return; |
|
| 36 | + } |
|
| 35 | 37 | $out = ob_get_clean(); |
| 36 | 38 | $status = $this->getStatus(); |
| 37 | 39 | if ($status == BaseTestRunner::STATUS_ERROR |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->me['struct'] = $val; |
| 88 | 88 | break; |
| 89 | 89 | default: |
| 90 | - Logger::instance()->errorLog("XML-RPC: " . __METHOD__ . ": not a known type ($type)"); |
|
| 90 | + Logger::instance()->errorLog("XML-RPC: ".__METHOD__.": not a known type ($type)"); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if ($typeOf !== 1) { |
| 115 | - Logger::instance()->errorLog("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)"); |
|
| 115 | + Logger::instance()->errorLog("XML-RPC: ".__METHOD__.": not a scalar type ($type)"); |
|
| 116 | 116 | return 0; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -129,10 +129,10 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | switch ($this->mytype) { |
| 131 | 131 | case 1: |
| 132 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value'); |
|
| 132 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value'); |
|
| 133 | 133 | return 0; |
| 134 | 134 | case 3: |
| 135 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value'); |
|
| 135 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value'); |
|
| 136 | 136 | return 0; |
| 137 | 137 | case 2: |
| 138 | 138 | // we're adding a scalar value to an array here |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | return 1; |
| 176 | 176 | } else { |
| 177 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
| 177 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
| 178 | 178 | return 0; |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | return 1; |
| 207 | 207 | } else { |
| 208 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
| 208 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
| 209 | 209 | return 0; |
| 210 | 210 | } |
| 211 | 211 | } |
@@ -241,19 +241,19 @@ discard block |
||
| 241 | 241 | case 1: |
| 242 | 242 | switch ($typ) { |
| 243 | 243 | case static::$xmlrpcBase64: |
| 244 | - $rs .= "<${typ}>" . base64_encode($val) . "</${typ}>"; |
|
| 244 | + $rs .= "<${typ}>".base64_encode($val)."</${typ}>"; |
|
| 245 | 245 | break; |
| 246 | 246 | case static::$xmlrpcBoolean: |
| 247 | - $rs .= "<${typ}>" . ($val ? '1' : '0') . "</${typ}>"; |
|
| 247 | + $rs .= "<${typ}>".($val ? '1' : '0')."</${typ}>"; |
|
| 248 | 248 | break; |
| 249 | 249 | case static::$xmlrpcString: |
| 250 | 250 | // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml |
| 251 | - $rs .= "<${typ}>" . Charset::instance()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</${typ}>"; |
|
| 251 | + $rs .= "<${typ}>".Charset::instance()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</${typ}>"; |
|
| 252 | 252 | break; |
| 253 | 253 | case static::$xmlrpcInt: |
| 254 | 254 | case static::$xmlrpcI4: |
| 255 | 255 | case static::$xmlrpcI8: |
| 256 | - $rs .= "<${typ}>" . (int)$val . "</${typ}>"; |
|
| 256 | + $rs .= "<${typ}>".(int) $val."</${typ}>"; |
|
| 257 | 257 | break; |
| 258 | 258 | case static::$xmlrpcDouble: |
| 259 | 259 | // avoid using standard conversion of float to string because it is locale-dependent, |
@@ -261,15 +261,15 @@ discard block |
||
| 261 | 261 | // sprintf('%F') could be most likely ok but it fails eg. on 2e-14. |
| 262 | 262 | // The code below tries its best at keeping max precision while avoiding exp notation, |
| 263 | 263 | // but there is of course no limit in the number of decimal places to be used... |
| 264 | - $rs .= "<${typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</${typ}>"; |
|
| 264 | + $rs .= "<${typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</${typ}>"; |
|
| 265 | 265 | break; |
| 266 | 266 | case static::$xmlrpcDateTime: |
| 267 | 267 | if (is_string($val)) { |
| 268 | 268 | $rs .= "<${typ}>${val}</${typ}>"; |
| 269 | 269 | } elseif (is_a($val, 'DateTime')) { |
| 270 | - $rs .= "<${typ}>" . $val->format('Ymd\TH:i:s') . "</${typ}>"; |
|
| 270 | + $rs .= "<${typ}>".$val->format('Ymd\TH:i:s')."</${typ}>"; |
|
| 271 | 271 | } elseif (is_int($val)) { |
| 272 | - $rs .= "<${typ}>" . strftime("%Y%m%dT%H:%M:%S", $val) . "</${typ}>"; |
|
| 272 | + $rs .= "<${typ}>".strftime("%Y%m%dT%H:%M:%S", $val)."</${typ}>"; |
|
| 273 | 273 | } else { |
| 274 | 274 | // not really a good idea here: but what shall we output anyway? left for backward compat... |
| 275 | 275 | $rs .= "<${typ}>${val}</${typ}>"; |
@@ -291,14 +291,14 @@ discard block |
||
| 291 | 291 | case 3: |
| 292 | 292 | // struct |
| 293 | 293 | if ($this->_php_class) { |
| 294 | - $rs .= '<struct php_class="' . $this->_php_class . "\">\n"; |
|
| 294 | + $rs .= '<struct php_class="'.$this->_php_class."\">\n"; |
|
| 295 | 295 | } else { |
| 296 | 296 | $rs .= "<struct>\n"; |
| 297 | 297 | } |
| 298 | 298 | $charsetEncoder = Charset::instance(); |
| 299 | 299 | /** @var Value $val2 */ |
| 300 | 300 | foreach ($val as $key2 => $val2) { |
| 301 | - $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n"; |
|
| 301 | + $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n"; |
|
| 302 | 302 | //$rs.=$this->serializeval($val2); |
| 303 | 303 | $rs .= $val2->serialize($charsetEncoding); |
| 304 | 304 | $rs .= "</member>\n"; |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $val = reset($this->me); |
| 335 | 335 | $typ = key($this->me); |
| 336 | 336 | |
| 337 | - return '<value>' . $this->serializedata($typ, $val, $charsetEncoding) . "</value>\n"; |
|
| 337 | + return '<value>'.$this->serializedata($typ, $val, $charsetEncoding)."</value>\n"; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |