@@ -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['HTTPSERVER']); |
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['HTTPSERVER'], 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 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | // check for command line (env vars) vs. web page input params |
45 | 45 | if (!isset($_SERVER['REQUEST_METHOD'])) { |
46 | - foreach($_SERVER as $key => $val) { |
|
46 | + foreach ($_SERVER as $key => $val) { |
|
47 | 47 | if (array_key_exists($key, $args)) { |
48 | 48 | $$key = $val; |
49 | 49 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | if ($HTTPURI[0] != '/') { |
90 | - $HTTPURI = '/' . $HTTPURI; |
|
90 | + $HTTPURI = '/'.$HTTPURI; |
|
91 | 91 | } |
92 | 92 | $args['HTTPURI'] = $HTTPURI; |
93 | 93 | |
@@ -101,21 +101,21 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($HTTPSIGNOREPEER)) { |
104 | - $args['HTTPSIGNOREPEER'] = (bool)$HTTPSIGNOREPEER; |
|
104 | + $args['HTTPSIGNOREPEER'] = (bool) $HTTPSIGNOREPEER; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if (isset($HTTPSVERIFYHOST)) { |
108 | - $args['HTTPSVERIFYHOST'] = (int)$HTTPSVERIFYHOST; |
|
108 | + $args['HTTPSVERIFYHOST'] = (int) $HTTPSVERIFYHOST; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | if (isset($SSLVERSION)) { |
112 | - $args['SSLVERSION'] = (int)$SSLVERSION; |
|
112 | + $args['SSLVERSION'] = (int) $SSLVERSION; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (isset($PROXYSERVER)) { |
116 | 116 | $arr = explode(':', $PROXYSERVER); |
117 | 117 | $args['PROXYSERVER'] = $arr[0]; |
118 | - if (count($arr) > 1) { |
|
118 | + if (count($arr)>1) { |
|
119 | 119 | $args['PROXYPORT'] = $arr[1]; |
120 | 120 | } else { |
121 | 121 | $args['PROXYPORT'] = 8080; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LocalFileTestCase.php'; |
|
3 | +include_once __DIR__.'/LocalFileTestCase.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests for php files in the 'extras' directory |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | { |
12 | 12 | $this->args = argParser::getArgs(); |
13 | 13 | |
14 | - $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/', $this->args['HTTPURI'] ); |
|
14 | + $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/tests/', $this->args['HTTPURI']); |
|
15 | 15 | |
16 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
|
16 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function testVerifyCompat() |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LocalFileTestCase.php'; |
|
3 | +include_once __DIR__.'/LocalFileTestCase.php'; |
|
4 | 4 | |
5 | 5 | class DebuggerTest extends PhpXmlRpc_LocalFileTestCase |
6 | 6 | { |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | { |
9 | 9 | $this->args = argParser::getArgs(); |
10 | 10 | |
11 | - $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/debugger/', $this->args['HTTPURI'] ); |
|
11 | + $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/debugger/', $this->args['HTTPURI']); |
|
12 | 12 | |
13 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
|
13 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function testIndex() |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LocalFileTestCase.php'; |
|
3 | +include_once __DIR__.'/LocalFileTestCase.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests for php files in the 'demo' directory |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | { |
12 | 12 | $this->args = argParser::getArgs(); |
13 | 13 | |
14 | - $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['HTTPURI'] ); |
|
14 | + $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/demo/', $this->args['HTTPURI']); |
|
15 | 15 | |
16 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
|
16 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function testAgeSort() |
@@ -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($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['HTTPSERVER']); |
91 | - if (count($server) > 1) { |
|
91 | + if (count($server)>1) { |
|
92 | 92 | $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]); |
93 | 93 | } else { |
94 | 94 | $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']); |
@@ -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['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
|
101 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
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['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
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 |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | use PhpXmlRpc\Response; |
20 | 20 | use PhpXmlRpc\Encoder; |
21 | 21 | |
22 | -include_once __DIR__ . '/../vendor/autoload.php'; |
|
22 | +include_once __DIR__.'/../vendor/autoload.php'; |
|
23 | 23 | |
24 | -include __DIR__ . '/parse_args.php'; |
|
24 | +include __DIR__.'/parse_args.php'; |
|
25 | 25 | $args = argParser::getArgs(); |
26 | 26 | |
27 | 27 | function begin_test($test_name, $test_case) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if (!isset($test_results[$test_name][$test_case])) { |
42 | 42 | trigger_error('ending test that was not started'); |
43 | 43 | } |
44 | - $test_results[$test_name][$test_case]['time'] = $end - $test_results[$test_name][$test_case]['time']; |
|
44 | + $test_results[$test_name][$test_case]['time'] = $end-$test_results[$test_name][$test_case]['time']; |
|
45 | 45 | $test_results[$test_name][$test_case]['result'] = $test_result; |
46 | 46 | echo '.'; |
47 | 47 | flush(); |
@@ -75,24 +75,24 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | if ($is_web) { |
78 | - echo "<h3>Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "</h3>\n"; |
|
78 | + echo "<h3>Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."</h3>\n"; |
|
79 | 79 | if ($xd) { |
80 | - echo "<h4>XDEBUG profiling enabled: skipping remote tests. Trace file is: " . htmlspecialchars(xdebug_get_profiler_filename()) . "</h4>\n"; |
|
80 | + echo "<h4>XDEBUG profiling enabled: skipping remote tests. Trace file is: ".htmlspecialchars(xdebug_get_profiler_filename())."</h4>\n"; |
|
81 | 81 | } |
82 | 82 | flush(); |
83 | 83 | ob_flush(); |
84 | 84 | } else { |
85 | - echo "Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "\n"; |
|
85 | + echo "Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."\n"; |
|
86 | 86 | if ($xd) { |
87 | - echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: " . xdebug_get_profiler_filename() . "\n"; |
|
87 | + echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: ".xdebug_get_profiler_filename()."\n"; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | 91 | // test 'manual style' data encoding vs. 'automatic style' encoding |
92 | 92 | begin_test('Data encoding (large array)', 'manual encoding'); |
93 | -for ($i = 0; $i < $num_tests; $i++) { |
|
93 | +for ($i = 0; $i<$num_tests; $i++) { |
|
94 | 94 | $vals = array(); |
95 | - for ($j = 0; $j < 10; $j++) { |
|
95 | + for ($j = 0; $j<10; $j++) { |
|
96 | 96 | $valarray = array(); |
97 | 97 | foreach ($data[$j] as $key => $val) { |
98 | 98 | $values = array(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | begin_test('Data encoding (large array)', 'automatic encoding'); |
119 | 119 | $encoder = new Encoder(); |
120 | -for ($i = 0; $i < $num_tests; $i++) { |
|
120 | +for ($i = 0; $i<$num_tests; $i++) { |
|
121 | 121 | $value = $encoder->encode($data, array('auto_dates')); |
122 | 122 | $out = $value->serialize(); |
123 | 123 | } |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | |
126 | 126 | if (function_exists('xmlrpc_set_type')) { |
127 | 127 | begin_test('Data encoding (large array)', 'xmlrpc-epi encoding'); |
128 | - for ($i = 0; $i < $num_tests; $i++) { |
|
129 | - for ($j = 0; $j < 10; $j++) { |
|
128 | + for ($i = 0; $i<$num_tests; $i++) { |
|
129 | + for ($j = 0; $j<10; $j++) { |
|
130 | 130 | foreach ($keys as $k) { |
131 | 131 | xmlrpc_set_type($data[$j][$k][4], 'datetime'); |
132 | 132 | xmlrpc_set_type($data[$j][$k][8], 'datetime'); |
@@ -140,18 +140,18 @@ discard block |
||
140 | 140 | // test 'old style' data decoding vs. 'automatic style' decoding |
141 | 141 | $dummy = new Request(''); |
142 | 142 | $out = new Response($value); |
143 | -$in = '<?xml version="1.0" ?>' . "\n" . $out->serialize(); |
|
143 | +$in = '<?xml version="1.0" ?>'."\n".$out->serialize(); |
|
144 | 144 | |
145 | 145 | begin_test('Data decoding (large array)', 'manual decoding'); |
146 | -for ($i = 0; $i < $num_tests; $i++) { |
|
146 | +for ($i = 0; $i<$num_tests; $i++) { |
|
147 | 147 | $response = $dummy->ParseResponse($in, true); |
148 | 148 | $value = $response->value(); |
149 | 149 | $result = array(); |
150 | - foreach($value as $val1) { |
|
150 | + foreach ($value as $val1) { |
|
151 | 151 | $out = array(); |
152 | - foreach($val1 as $name => $val) { |
|
152 | + foreach ($val1 as $name => $val) { |
|
153 | 153 | $out[$name] = array(); |
154 | - foreach($val as $data) { |
|
154 | + foreach ($val as $data) { |
|
155 | 155 | $out[$name][] = $data->scalarval(); |
156 | 156 | } |
157 | 157 | } |
@@ -161,18 +161,18 @@ discard block |
||
161 | 161 | end_test('Data decoding (large array)', 'manual decoding', $result); |
162 | 162 | |
163 | 163 | begin_test('Data decoding (large array)', 'manual decoding deprecated'); |
164 | -for ($i = 0; $i < $num_tests; $i++) { |
|
164 | +for ($i = 0; $i<$num_tests; $i++) { |
|
165 | 165 | $response = $dummy->ParseResponse($in, true); |
166 | 166 | $value = $response->value(); |
167 | 167 | $result = array(); |
168 | 168 | $l = $value->arraysize(); |
169 | - for ($k = 0; $k < $l; $k++) { |
|
169 | + for ($k = 0; $k<$l; $k++) { |
|
170 | 170 | $val1 = $value->arraymem($k); |
171 | 171 | $out = array(); |
172 | - foreach($val1 as $name => $val) { |
|
172 | + foreach ($val1 as $name => $val) { |
|
173 | 173 | $out[$name] = array(); |
174 | 174 | $m = $val->arraysize(); |
175 | - for ($j = 0; $j < $m; $j++) { |
|
175 | + for ($j = 0; $j<$m; $j++) { |
|
176 | 176 | $data = $val->arraymem($j); |
177 | 177 | $out[$name][] = $data->scalarval(); |
178 | 178 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | end_test('Data decoding (large array)', 'manual decoding deprecated', $result); |
184 | 184 | |
185 | 185 | begin_test('Data decoding (large array)', 'automatic decoding'); |
186 | -for ($i = 0; $i < $num_tests; $i++) { |
|
186 | +for ($i = 0; $i<$num_tests; $i++) { |
|
187 | 187 | $response = $dummy->ParseResponse($in, true, 'phpvals'); |
188 | 188 | $value = $response->value(); |
189 | 189 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | if (function_exists('xmlrpc_decode')) { |
193 | 193 | begin_test('Data decoding (large array)', 'xmlrpc-epi decoding'); |
194 | - for ($i = 0; $i < $num_tests; $i++) { |
|
194 | + for ($i = 0; $i<$num_tests; $i++) { |
|
195 | 195 | $response = $dummy->ParseResponse($in, true, 'xml'); |
196 | 196 | $value = xmlrpc_decode($response->value()); |
197 | 197 | } |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | $value = $encoder->encode($data1, array('auto_dates')); |
208 | 208 | $req = new Request('interopEchoTests.echoValue', array($value)); |
209 | 209 | $reqs = array(); |
210 | - for ($i = 0; $i < $num_tests; $i++) { |
|
210 | + for ($i = 0; $i<$num_tests; $i++) { |
|
211 | 211 | $reqs[] = $req; |
212 | 212 | } |
213 | 213 | $server = explode(':', $args['HTTPSERVER']); |
214 | - if (count($server) > 1) { |
|
215 | - $srv = $server[1] . '://' . $server[0] . $args['HTTPURI']; |
|
214 | + if (count($server)>1) { |
|
215 | + $srv = $server[1].'://'.$server[0].$args['HTTPURI']; |
|
216 | 216 | $c = new Client($args['HTTPURI'], $server[0], $server[1]); |
217 | 217 | } else { |
218 | - $srv = $args['HTTPSERVER'] . $args['HTTPURI']; |
|
218 | + $srv = $args['HTTPSERVER'].$args['HTTPURI']; |
|
219 | 219 | $c = new Client($args['HTTPURI'], $args['HTTPSERVER']); |
220 | 220 | } |
221 | 221 | // do not interfere with http compression |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | begin_test($testName, 'http 10'); |
231 | 231 | $response = array(); |
232 | - for ($i = 0; $i < $num_tests; $i++) { |
|
232 | + for ($i = 0; $i<$num_tests; $i++) { |
|
233 | 233 | $resp = $c->send($req); |
234 | 234 | $response[] = $resp->value(); |
235 | 235 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | if (function_exists('curl_init')) { |
239 | 239 | begin_test($testName, 'http 11 w. keep-alive'); |
240 | 240 | $response = array(); |
241 | - for ($i = 0; $i < $num_tests; $i++) { |
|
241 | + for ($i = 0; $i<$num_tests; $i++) { |
|
242 | 242 | $resp = $c->send($req, 10, 'http11'); |
243 | 243 | $response[] = $resp->value(); |
244 | 244 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $c->keepalive = false; |
248 | 248 | begin_test($testName, 'http 11'); |
249 | 249 | $response = array(); |
250 | - for ($i = 0; $i < $num_tests; $i++) { |
|
250 | + for ($i = 0; $i<$num_tests; $i++) { |
|
251 | 251 | $resp = $c->send($req, 10, 'http11'); |
252 | 252 | $response[] = $resp->value(); |
253 | 253 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | begin_test($testName, 'http 10 w. compression'); |
269 | 269 | $response = array(); |
270 | - for ($i = 0; $i < $num_tests; $i++) { |
|
270 | + for ($i = 0; $i<$num_tests; $i++) { |
|
271 | 271 | $resp = $c->send($req); |
272 | 272 | $response[] = $resp->value(); |
273 | 273 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | if (function_exists('curl_init')) { |
277 | 277 | begin_test($testName, 'http 11 w. keep-alive and compression'); |
278 | 278 | $response = array(); |
279 | - for ($i = 0; $i < $num_tests; $i++) { |
|
279 | + for ($i = 0; $i<$num_tests; $i++) { |
|
280 | 280 | $resp = $c->send($req, 10, 'http11'); |
281 | 281 | $response[] = $resp->value(); |
282 | 282 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $c->keepalive = false; |
286 | 286 | begin_test($testName, 'http 11 w. compression'); |
287 | 287 | $response = array(); |
288 | - for ($i = 0; $i < $num_tests; $i++) { |
|
288 | + for ($i = 0; $i<$num_tests; $i++) { |
|
289 | 289 | $resp = $c->send($req, 10, 'http11'); |
290 | 290 | $response[] = $resp->value(); |
291 | 291 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | foreach ($test_results as $test => $results) { |
307 | 307 | echo "\nTEST: $test\n"; |
308 | 308 | foreach ($results as $case => $data) { |
309 | - echo " $case: {$data['time']} secs - Output data CRC: " . crc32(serialize($data['result'])) . "\n"; |
|
309 | + echo " $case: {$data['time']} secs - Output data CRC: ".crc32(serialize($data['result']))."\n"; |
|
310 | 310 | } |
311 | 311 | } |
312 | 312 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . "/_prepend.php"; |
|
3 | +require_once __DIR__."/_prepend.php"; |
|
4 | 4 | |
5 | 5 | use PhpXmlRpc\Value; |
6 | 6 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | $count = 0; |
32 | 32 | } |
33 | 33 | // add the new comment in |
34 | - dba_insert($msgID . "_comment_${count}", $comment, $dbh); |
|
35 | - dba_insert($msgID . "_name_${count}", $name, $dbh); |
|
34 | + dba_insert($msgID."_comment_${count}", $comment, $dbh); |
|
35 | + dba_insert($msgID."_name_${count}", $name, $dbh); |
|
36 | 36 | $count++; |
37 | 37 | dba_replace($countID, $count, $dbh); |
38 | 38 | dba_close($dbh); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $countID = "${msgID}_count"; |
66 | 66 | if (dba_exists($countID, $dbh)) { |
67 | 67 | $count = dba_fetch($countID, $dbh); |
68 | - for ($i = 0; $i < $count; $i++) { |
|
68 | + for ($i = 0; $i<$count; $i++) { |
|
69 | 69 | $name = dba_fetch("${msgID}_name_${i}", $dbh); |
70 | 70 | $comment = dba_fetch("${msgID}_comment_${i}", $dbh); |
71 | 71 | // push a new struct onto the return array |
@@ -101,4 +101,4 @@ discard block |
||
101 | 101 | ), |
102 | 102 | )); |
103 | 103 | |
104 | -require_once __DIR__ . "/_append.php"; |
|
104 | +require_once __DIR__."/_append.php"; |
@@ -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 | } |