@@ -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 | /** |
| 10 | 10 | * Tests involving requests sent to non-existing servers |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | // make sure there's no freaking catchall DNS in effect |
| 58 | 58 | $dnsinfo = dns_get_record($this->client->server); |
| 59 | 59 | if ($dnsinfo) { |
| 60 | - $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found'); |
|
| 60 | + $this->markTestSkipped('Seems like there is a catchall DNS in effect: host '.$this->client->server.' found'); |
|
| 61 | 61 | } else { |
| 62 | 62 | $this->assertEquals(5, $r->faultCode()); |
| 63 | 63 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | // now test a successful connection |
| 84 | 84 | $server = explode(':', $this->args['LOCALSERVER']); |
| 85 | - if (count($server) > 1) { |
|
| 85 | + if (count($server)>1) { |
|
| 86 | 86 | $this->client->port = $server[1]; |
| 87 | 87 | } |
| 88 | 88 | $this->client->server = $server[0]; |
@@ -22,14 +22,16 @@ |
||
| 22 | 22 | $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['LOCALSERVER'], 80); |
| 23 | 23 | $this->client->setDebug($this->args['DEBUG']); |
| 24 | 24 | |
| 25 | - if ($this->args['DEBUG'] == 1) |
|
| 26 | - ob_start(); |
|
| 25 | + if ($this->args['DEBUG'] == 1) { |
|
| 26 | + ob_start(); |
|
| 27 | + } |
|
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | protected function tear_down() |
| 30 | 31 | { |
| 31 | - if ($this->args['DEBUG'] != 1) |
|
| 32 | - return; |
|
| 32 | + if ($this->args['DEBUG'] != 1) { |
|
| 33 | + return; |
|
| 34 | + } |
|
| 33 | 35 | $out = ob_get_clean(); |
| 34 | 36 | $status = $this->getStatus(); |
| 35 | 37 | if ($status == PHPUnit_Runner_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\Framework\TestResult; |
| 8 | 8 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public function _run(TestResult $result = NULL) |
| 21 | 21 | { |
| 22 | - $this->testId = get_class($this) . '__' . $this->getName(); |
|
| 22 | + $this->testId = get_class($this).'__'.$this->getName(); |
|
| 23 | 23 | |
| 24 | 24 | if ($result === NULL) { |
| 25 | 25 | $result = $this->createResult(); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | protected function request($file, $method = 'GET', $payload = '', $emptyPageOk = false) |
| 49 | 49 | { |
| 50 | - $url = $this->baseUrl . $file; |
|
| 50 | + $url = $this->baseUrl.$file; |
|
| 51 | 51 | |
| 52 | 52 | $ch = curl_init($url); |
| 53 | 53 | curl_setopt_array($ch, array( |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | curl_setopt($ch, CURLOPT_COOKIE, 'PHPUNIT_SELENIUM_TEST_ID=true'); |
| 67 | 67 | } |
| 68 | - if ($this->args['DEBUG'] > 0) { |
|
| 68 | + if ($this->args['DEBUG']>0) { |
|
| 69 | 69 | curl_setopt($ch, CURLOPT_VERBOSE, 1); |
| 70 | 70 | } |
| 71 | 71 | $page = curl_exec($ch); |
@@ -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 | /** |
| 13 | 13 | * Tests involving parsing of xml and handling of xmlrpc values |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function testUnicodeInMemberName() |
| 65 | 65 | { |
| 66 | - $str = "G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
| 66 | + $str = "G".chr(252)."nter, El".chr(232)."ne"; |
|
| 67 | 67 | $v = array($str => new xmlrpcval(1)); |
| 68 | 68 | $r = new xmlrpcresp(new xmlrpcval($v, 'struct')); |
| 69 | 69 | $r = $r->serialize(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | '<?xml version="1.0"?> |
| 80 | 80 | <!-- $Id --> |
| 81 | 81 | <!-- found by G. Giunta, covers what happens when lib receives UTF8 chars in response text and comments --> |
| 82 | -<!-- ' . chr(224) . chr(252) . chr(232) . 'àüè --> |
|
| 82 | +<!-- ' . chr(224).chr(252).chr(232).'àüè --> |
|
| 83 | 83 | <methodResponse> |
| 84 | 84 | <fault> |
| 85 | 85 | <value> |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | </member> |
| 91 | 91 | <member> |
| 92 | 92 | <name>faultString</name> |
| 93 | -<value><string>' . chr(224) . chr(252) . chr(232) . 'àüè</string></value> |
|
| 93 | +<value><string>' . chr(224).chr(252).chr(232).'àüè</string></value> |
|
| 94 | 94 | </member> |
| 95 | 95 | </struct> |
| 96 | 96 | </value> |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $m = $this->newMsg('dummy'); |
| 100 | 100 | $r = $m->parseResponse($response); |
| 101 | 101 | $v = $r->faultString(); |
| 102 | - $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v); |
|
| 102 | + $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | public function testValidNumbers() |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | public function testI8() |
| 162 | 162 | { |
| 163 | - if (PHP_INT_SIZE == 4 ) { |
|
| 163 | + if (PHP_INT_SIZE == 4) { |
|
| 164 | 164 | $this->markTestSkipped('did not find a locale which sets decimal separator to comma'); |
| 165 | 165 | return; |
| 166 | 166 | } |
@@ -483,11 +483,11 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | public function testUTF8Response() |
| 485 | 485 | { |
| 486 | - $string = chr(224) . chr(252) . chr(232); |
|
| 486 | + $string = chr(224).chr(252).chr(232); |
|
| 487 | 487 | |
| 488 | 488 | $s = $this->newMsg('dummy'); |
| 489 | - $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> |
|
| 490 | -<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> |
|
| 489 | + $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> |
|
| 490 | +<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 | 491 | '; |
| 492 | 492 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 493 | 493 | $v = $r->value(); |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | $this->assertEquals($string, $v); |
| 496 | 496 | |
| 497 | 497 | $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
| 498 | -<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> |
|
| 498 | +<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> |
|
| 499 | 499 | '; |
| 500 | 500 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 501 | 501 | $v = $r->value(); |
@@ -510,11 +510,11 @@ discard block |
||
| 510 | 510 | |
| 511 | 511 | public function testLatin1Response() |
| 512 | 512 | { |
| 513 | - $string = chr(224) . chr(252) . chr(232); |
|
| 513 | + $string = chr(224).chr(252).chr(232); |
|
| 514 | 514 | |
| 515 | 515 | $s = $this->newMsg('dummy'); |
| 516 | - $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> |
|
| 517 | -<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> |
|
| 516 | + $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> |
|
| 517 | +<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 | 518 | '; |
| 519 | 519 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 520 | 520 | $v = $r->value(); |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $this->assertEquals($string, $v); |
| 523 | 523 | |
| 524 | 524 | $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
| 525 | -<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> |
|
| 525 | +<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> |
|
| 526 | 526 | '; |
| 527 | 527 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 528 | 528 | $v = $r->value(); |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $this->assertequals(1, count($v1)); |
| 618 | 618 | $out = array('me' => array(), 'mytype' => 2, '_php_class' => null); |
| 619 | 619 | |
| 620 | - foreach($v1 as $key => $val) |
|
| 620 | + foreach ($v1 as $key => $val) |
|
| 621 | 621 | { |
| 622 | 622 | $this->assertArrayHasKey($key, $out); |
| 623 | 623 | $expected = $out[$key]; |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | $this->assertequals(2, count($v2)); |
| 633 | 633 | $out = array(array('key' => 0, 'value' => 'object'), array('key' => 1, 'value' => 'object')); |
| 634 | 634 | $i = 0; |
| 635 | - foreach($v2 as $key => $val) |
|
| 635 | + foreach ($v2 as $key => $val) |
|
| 636 | 636 | { |
| 637 | 637 | $expected = $out[$i]; |
| 638 | 638 | $this->assertequals($expected['key'], $key); |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | { |
| 646 | 646 | // nb: make sure that the serialized xml corresponding to this is > 10MB in size |
| 647 | 647 | $data = array(); |
| 648 | - for ($i = 0; $i < 500000; $i++ ) { |
|
| 648 | + for ($i = 0; $i<500000; $i++) { |
|
| 649 | 649 | $data[] = 'hello world'; |
| 650 | 650 | } |
| 651 | 651 | |
@@ -19,14 +19,16 @@ |
||
| 19 | 19 | protected function set_up() |
| 20 | 20 | { |
| 21 | 21 | $this->args = argParser::getArgs(); |
| 22 | - if ($this->args['DEBUG'] == 1) |
|
| 23 | - ob_start(); |
|
| 22 | + if ($this->args['DEBUG'] == 1) { |
|
| 23 | + ob_start(); |
|
| 24 | + } |
|
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | protected function tear_down() |
| 27 | 28 | { |
| 28 | - if ($this->args['DEBUG'] != 1) |
|
| 29 | - return; |
|
| 29 | + if ($this->args['DEBUG'] != 1) { |
|
| 30 | + return; |
|
| 31 | + } |
|
| 30 | 32 | $out = ob_get_clean(); |
| 31 | 33 | $status = $this->getStatus(); |
| 32 | 34 | if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | use PhpXmlRpc\Helper\Charset; |
| 7 | 7 | |
| 8 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
| 8 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Test conversion between encodings |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | // construct a latin string with all chars (except control ones) |
| 30 | 30 | $this->latinString = "\n\r\t"; |
| 31 | - for($i = 32; $i < 127; $i++) { |
|
| 31 | + for ($i = 32; $i<127; $i++) { |
|
| 32 | 32 | $this->latinString .= chr($i); |
| 33 | 33 | } |
| 34 | - for($i = 160; $i < 256; $i++) { |
|
| 34 | + for ($i = 160; $i<256; $i++) { |
|
| 35 | 35 | $this->latinString .= chr($i); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -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\Framework\TestResult; |
| 11 | 11 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | // (but only if not called from subclass objects / multitests) |
| 37 | 37 | if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') { |
| 38 | 38 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
| 39 | - for ($i = 0; $i < count($trace); $i++) { |
|
| 39 | + for ($i = 0; $i<count($trace); $i++) { |
|
| 40 | 40 | if (strpos($trace[$i]['function'], 'test') === 0) { |
| 41 | 41 | self::$failed_tests[$trace[$i]['function']] = true; |
| 42 | 42 | break; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function _run(TestResult $result = NULL) |
| 59 | 59 | { |
| 60 | - $this->testId = get_class($this) . '__' . $this->getName(); |
|
| 60 | + $this->testId = get_class($this).'__'.$this->getName(); |
|
| 61 | 61 | |
| 62 | 62 | if ($result === NULL) { |
| 63 | 63 | $result = $this->createResult(); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $this->args = argParser::getArgs(); |
| 89 | 89 | |
| 90 | 90 | $server = explode(':', $this->args['LOCALSERVER']); |
| 91 | - if (count($server) > 1) { |
|
| 91 | + if (count($server)>1) { |
|
| 92 | 92 | $this->client = new xmlrpc_client($this->args['URI'], $server[0], $server[1]); |
| 93 | 93 | } else { |
| 94 | 94 | $this->client = new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $this->client->request_compression = $this->request_compression; |
| 99 | 99 | $this->client->accepted_compression = $this->accepted_compression; |
| 100 | 100 | |
| 101 | - $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
|
| 101 | + $this->coverageScriptUrl = 'http://'.$this->args['LOCALSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI']); |
|
| 102 | 102 | |
| 103 | 103 | if ($this->args['DEBUG'] == 1) |
| 104 | 104 | ob_start(); |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | return $r; |
| 135 | 135 | } |
| 136 | 136 | if (is_array($errorCode)) { |
| 137 | - $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 137 | + $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 138 | 138 | } else { |
| 139 | - $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 139 | + $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 140 | 140 | } |
| 141 | 141 | if (!$r->faultCode()) { |
| 142 | 142 | if ($returnResponse) { |
@@ -158,20 +158,20 @@ discard block |
||
| 158 | 158 | $query = parse_url($this->client->path, PHP_URL_QUERY); |
| 159 | 159 | parse_str($query, $vars); |
| 160 | 160 | $query = http_build_query(array_merge($vars, $data)); |
| 161 | - $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query; |
|
| 161 | + $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | public function testString() |
| 165 | 165 | { |
| 166 | - $sendString = "here are 3 \"entities\": < > & " . |
|
| 167 | - "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . |
|
| 168 | - " - isn't that great? \\\"hackery\\\" at it's best " . |
|
| 169 | - " also don't want to miss out on \$item[0]. " . |
|
| 170 | - "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . |
|
| 171 | - "a simple CR here" . chr(13) . |
|
| 172 | - "a simple LF here" . chr(10) . |
|
| 173 | - "and then LFCR" . chr(10) . chr(13) . |
|
| 174 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; |
|
| 166 | + $sendString = "here are 3 \"entities\": < > & ". |
|
| 167 | + "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92). |
|
| 168 | + " - isn't that great? \\\"hackery\\\" at it's best ". |
|
| 169 | + " also don't want to miss out on \$item[0]. ". |
|
| 170 | + "The real weird stuff follows: CRLF here".chr(13).chr(10). |
|
| 171 | + "a simple CR here".chr(13). |
|
| 172 | + "a simple LF here".chr(10). |
|
| 173 | + "and then LFCR".chr(10).chr(13). |
|
| 174 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; |
|
| 175 | 175 | $m = new xmlrpcmsg('examples.stringecho', array( |
| 176 | 176 | new xmlrpcval($sendString, 'string'), |
| 177 | 177 | )); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | public function testLatin1String() |
| 193 | 193 | { |
| 194 | 194 | $sendString = |
| 195 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
| 195 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne"; |
|
| 196 | 196 | $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'. |
| 197 | 197 | $sendString. |
| 198 | 198 | '</value></param></params></methodCall>'; |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | public function testUtf8Method() |
| 297 | 297 | { |
| 298 | 298 | PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8'; |
| 299 | - $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array( |
|
| 299 | + $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array( |
|
| 300 | 300 | new xmlrpcval('hello') |
| 301 | 301 | )); |
| 302 | 302 | $v = $this->send($m); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | )); |
| 319 | 319 | $v = $this->send($m); |
| 320 | 320 | if ($v) { |
| 321 | - $this->assertEquals($a + $b, $v->scalarval()); |
|
| 321 | + $this->assertEquals($a+$b, $v->scalarval()); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | )); |
| 331 | 331 | $v = $this->send($m); |
| 332 | 332 | if ($v) { |
| 333 | - $this->assertEquals(12 - 23, $v->scalarval()); |
|
| 333 | + $this->assertEquals(12-23, $v->scalarval()); |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | if ($v) { |
| 365 | 365 | $sz = $v->arraysize(); |
| 366 | 366 | $got = ''; |
| 367 | - for ($i = 0; $i < $sz; $i++) { |
|
| 367 | + for ($i = 0; $i<$sz; $i++) { |
|
| 368 | 368 | $b = $v->arraymem($i); |
| 369 | 369 | if ($b->scalarval()) { |
| 370 | 370 | $got .= '1'; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $got = ''; |
| 428 | 428 | $expected = '37210'; |
| 429 | 429 | $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes'); |
| 430 | - foreach($expect_array as $val) { |
|
| 430 | + foreach ($expect_array as $val) { |
|
| 431 | 431 | $b = $v->structmem($val); |
| 432 | 432 | $got .= $b->me['int']; |
| 433 | 433 | } |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | { |
| 857 | 857 | // make a 'deep client copy' as the original one might have many properties set |
| 858 | 858 | // also for speed only wrap one method of the whole server |
| 859 | - $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' )); |
|
| 859 | + $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/')); |
|
| 860 | 860 | if ($class == '') { |
| 861 | 861 | $this->fail('Registration of remote server failed'); |
| 862 | 862 | } else { |
@@ -895,9 +895,9 @@ discard block |
||
| 895 | 895 | $cookies = array( |
| 896 | 896 | //'c1' => array(), |
| 897 | 897 | 'c2' => array('value' => 'c2'), |
| 898 | - 'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30), |
|
| 899 | - 'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'), |
|
| 900 | - 'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
| 898 | + 'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30), |
|
| 899 | + 'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'), |
|
| 900 | + 'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
| 901 | 901 | ); |
| 902 | 902 | $cookiesval = php_xmlrpc_encode($cookies); |
| 903 | 903 | $m = new xmlrpcmsg('examples.setcookies', array($cookiesval)); |
@@ -945,10 +945,10 @@ discard block |
||
| 945 | 945 | $m = new xmlrpcmsg('examples.getcookies', array()); |
| 946 | 946 | foreach ($cookies as $cookie => $val) { |
| 947 | 947 | $this->client->setCookie($cookie, $val); |
| 948 | - $cookies[$cookie] = (string)$cookies[$cookie]; |
|
| 948 | + $cookies[$cookie] = (string) $cookies[$cookie]; |
|
| 949 | 949 | } |
| 950 | 950 | $r = $this->client->send($m, $this->timeout, $this->method); |
| 951 | - $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 951 | + $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 952 | 952 | if (!$r->faultCode()) { |
| 953 | 953 | $v = $r->value(); |
| 954 | 954 | $v = php_xmlrpc_decode($v); |
@@ -100,14 +100,16 @@ |
||
| 100 | 100 | |
| 101 | 101 | $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
| 102 | 102 | |
| 103 | - if ($this->args['DEBUG'] == 1) |
|
| 104 | - ob_start(); |
|
| 103 | + if ($this->args['DEBUG'] == 1) { |
|
| 104 | + ob_start(); |
|
| 105 | + } |
|
| 105 | 106 | } |
| 106 | 107 | |
| 107 | 108 | protected function tear_down() |
| 108 | 109 | { |
| 109 | - if ($this->args['DEBUG'] != 1) |
|
| 110 | - return; |
|
| 110 | + if ($this->args['DEBUG'] != 1) { |
|
| 111 | + return; |
|
| 112 | + } |
|
| 111 | 113 | $out = ob_get_clean(); |
| 112 | 114 | $status = $this->getStatus(); |
| 113 | 115 | if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |