@@ -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['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/debugger/', $this->args['URI'] ); |
|
| 11 | + $this->baseUrl = $this->args['LOCALSERVER'].str_replace('/demo/server/server.php', '/debugger/', $this->args['URI']); |
|
| 12 | 12 | |
| 13 | - $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
|
| 13 | + $this->coverageScriptUrl = 'http://'.$this->args['LOCALSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI']); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function testIndex() |
@@ -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__ . '/3LocalhostTest.php'; |
|
| 8 | +include_once __DIR__.'/3LocalhostTest.php'; |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Tests which stress http features of the library. |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | function _runtests() |
| 21 | 21 | { |
| 22 | 22 | $unsafeMethods = array('testHttps', 'testCatchExceptions', 'testUtf8Method', 'testServerComments', 'testExoticCharsetsRequests', 'testExoticCharsetsRequests2', 'testExoticCharsetsRequests3'); |
| 23 | - foreach(get_class_methods('LocalhostTest') as $method) |
|
| 23 | + foreach (get_class_methods('LocalhostTest') as $method) |
|
| 24 | 24 | { |
| 25 | - if(strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods)) |
|
| 25 | + if (strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods)) |
|
| 26 | 26 | { |
| 27 | 27 | if (!isset(self::$failed_tests[$method])) |
| 28 | 28 | $this->$method(); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | function testDeflate() |
| 38 | 38 | { |
| 39 | - if(!function_exists('gzdeflate')) |
|
| 39 | + if (!function_exists('gzdeflate')) |
|
| 40 | 40 | { |
| 41 | 41 | $this->markTestSkipped('Zlib missing: cannot test deflate functionality'); |
| 42 | 42 | return; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | function testGzip() |
| 50 | 50 | { |
| 51 | - if(!function_exists('gzdeflate')) |
|
| 51 | + if (!function_exists('gzdeflate')) |
|
| 52 | 52 | { |
| 53 | 53 | $this->markTestSkipped('Zlib missing: cannot test gzip functionality'); |
| 54 | 54 | return; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | function testKeepAlives() |
| 62 | 62 | { |
| 63 | - if(!function_exists('curl_init')) |
|
| 63 | + if (!function_exists('curl_init')) |
|
| 64 | 64 | { |
| 65 | 65 | $this->markTestSkipped('CURL missing: cannot test http 1.1'); |
| 66 | 66 | return; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | function testHttp11() |
| 85 | 85 | { |
| 86 | - if(!function_exists('curl_init')) |
|
| 86 | + if (!function_exists('curl_init')) |
|
| 87 | 87 | { |
| 88 | 88 | $this->markTestSkipped('CURL missing: cannot test http 1.1'); |
| 89 | 89 | return; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | function testHttp11Gzip() |
| 100 | 100 | { |
| 101 | - if(!function_exists('curl_init')) |
|
| 101 | + if (!function_exists('curl_init')) |
|
| 102 | 102 | { |
| 103 | 103 | $this->markTestSkipped('CURL missing: cannot test http 1.1'); |
| 104 | 104 | return; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | function testHttp11Deflate() |
| 115 | 115 | { |
| 116 | - if(!function_exists('curl_init')) |
|
| 116 | + if (!function_exists('curl_init')) |
|
| 117 | 117 | { |
| 118 | 118 | $this->markTestSkipped('CURL missing: cannot test http 1.1'); |
| 119 | 119 | return; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | function testHttp11Proxy() |
| 130 | 130 | { |
| 131 | - if(!function_exists('curl_init')) |
|
| 131 | + if (!function_exists('curl_init')) |
|
| 132 | 132 | { |
| 133 | 133 | $this->markTestSkipped('CURL missing: cannot test http 1.1 w. proxy'); |
| 134 | 134 | return; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | function testHttps() |
| 151 | 151 | { |
| 152 | - if(!function_exists('curl_init')) |
|
| 152 | + if (!function_exists('curl_init')) |
|
| 153 | 153 | { |
| 154 | 154 | $this->markTestSkipped('CURL missing: cannot test https functionality'); |
| 155 | 155 | return; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | function testHttpsProxy() |
| 168 | 168 | { |
| 169 | - if(!function_exists('curl_init')) |
|
| 169 | + if (!function_exists('curl_init')) |
|
| 170 | 170 | { |
| 171 | 171 | $this->markTestSkipped('CURL missing: cannot test https functionality'); |
| 172 | 172 | return; |
@@ -24,8 +24,9 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | if(strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods)) |
| 26 | 26 | { |
| 27 | - if (!isset(self::$failed_tests[$method])) |
|
| 28 | - $this->$method(); |
|
| 27 | + if (!isset(self::$failed_tests[$method])) { |
|
| 28 | + $this->$method(); |
|
| 29 | + } |
|
| 29 | 30 | } |
| 30 | 31 | /*if ($this->_failed) |
| 31 | 32 | { |
@@ -76,9 +77,9 @@ discard block |
||
| 76 | 77 | { |
| 77 | 78 | $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']); |
| 78 | 79 | $this->_runtests(); |
| 80 | + } else { |
|
| 81 | + $this->markTestSkipped('PROXY definition missing: cannot test proxy'); |
|
| 79 | 82 | } |
| 80 | - else |
|
| 81 | - $this->markTestSkipped('PROXY definition missing: cannot test proxy'); |
|
| 82 | 83 | } |
| 83 | 84 | |
| 84 | 85 | function testHttp11() |
@@ -132,8 +133,7 @@ discard block |
||
| 132 | 133 | { |
| 133 | 134 | $this->markTestSkipped('CURL missing: cannot test http 1.1 w. proxy'); |
| 134 | 135 | return; |
| 135 | - } |
|
| 136 | - else if ($this->args['PROXYSERVER'] == '') |
|
| 136 | + } else if ($this->args['PROXYSERVER'] == '') |
|
| 137 | 137 | { |
| 138 | 138 | $this->markTestSkipped('PROXY definition missing: cannot test proxy w. http 1.1'); |
| 139 | 139 | return; |
@@ -170,8 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $this->markTestSkipped('CURL missing: cannot test https functionality'); |
| 172 | 172 | return; |
| 173 | - } |
|
| 174 | - else if ($this->args['PROXYSERVER'] == '') |
|
| 173 | + } else if ($this->args['PROXYSERVER'] == '') |
|
| 175 | 174 | { |
| 176 | 175 | $this->markTestSkipped('PROXY definition missing: cannot test proxy w. http 1.1'); |
| 177 | 176 | return; |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | use PhpXmlRpc\Response; |
| 18 | 18 | use PhpXmlRpc\Encoder; |
| 19 | 19 | |
| 20 | -include_once __DIR__ . '/../vendor/autoload.php'; |
|
| 20 | +include_once __DIR__.'/../vendor/autoload.php'; |
|
| 21 | 21 | |
| 22 | -include __DIR__ . '/parse_args.php'; |
|
| 22 | +include __DIR__.'/parse_args.php'; |
|
| 23 | 23 | $args = argParser::getArgs(); |
| 24 | 24 | |
| 25 | 25 | function begin_test($test_name, $test_case) |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | if (!isset($test_results[$test_name][$test_case])) { |
| 40 | 40 | trigger_error('ending test that was not started'); |
| 41 | 41 | } |
| 42 | - $test_results[$test_name][$test_case]['time'] = $end - $test_results[$test_name][$test_case]['time']; |
|
| 42 | + $test_results[$test_name][$test_case]['time'] = $end-$test_results[$test_name][$test_case]['time']; |
|
| 43 | 43 | $test_results[$test_name][$test_case]['result'] = $test_result; |
| 44 | 44 | echo '.'; |
| 45 | 45 | flush(); |
@@ -73,24 +73,24 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | if ($is_web) { |
| 76 | - echo "<h3>Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "</h3>\n"; |
|
| 76 | + echo "<h3>Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."</h3>\n"; |
|
| 77 | 77 | if ($xd) { |
| 78 | - echo "<h4>XDEBUG profiling enabled: skipping remote tests. Trace file is: " . htmlspecialchars(xdebug_get_profiler_filename()) . "</h4>\n"; |
|
| 78 | + echo "<h4>XDEBUG profiling enabled: skipping remote tests. Trace file is: ".htmlspecialchars(xdebug_get_profiler_filename())."</h4>\n"; |
|
| 79 | 79 | } |
| 80 | 80 | flush(); |
| 81 | 81 | ob_flush(); |
| 82 | 82 | } else { |
| 83 | - echo "Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "\n"; |
|
| 83 | + echo "Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."\n"; |
|
| 84 | 84 | if ($xd) { |
| 85 | - echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: " . xdebug_get_profiler_filename() . "\n"; |
|
| 85 | + echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: ".xdebug_get_profiler_filename()."\n"; |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | // test 'manual style' data encoding vs. 'automatic style' encoding |
| 90 | 90 | begin_test('Data encoding (large array)', 'manual encoding'); |
| 91 | -for ($i = 0; $i < $num_tests; $i++) { |
|
| 91 | +for ($i = 0; $i<$num_tests; $i++) { |
|
| 92 | 92 | $vals = array(); |
| 93 | - for ($j = 0; $j < 10; $j++) { |
|
| 93 | + for ($j = 0; $j<10; $j++) { |
|
| 94 | 94 | $valarray = array(); |
| 95 | 95 | foreach ($data[$j] as $key => $val) { |
| 96 | 96 | $values = array(); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | begin_test('Data encoding (large array)', 'automatic encoding'); |
| 117 | 117 | $encoder = new Encoder(); |
| 118 | -for ($i = 0; $i < $num_tests; $i++) { |
|
| 118 | +for ($i = 0; $i<$num_tests; $i++) { |
|
| 119 | 119 | $value = $encoder->encode($data, array('auto_dates')); |
| 120 | 120 | $out = $value->serialize(); |
| 121 | 121 | } |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | if (function_exists('xmlrpc_set_type')) { |
| 125 | 125 | begin_test('Data encoding (large array)', 'xmlrpc-epi encoding'); |
| 126 | - for ($i = 0; $i < $num_tests; $i++) { |
|
| 127 | - for ($j = 0; $j < 10; $j++) { |
|
| 126 | + for ($i = 0; $i<$num_tests; $i++) { |
|
| 127 | + for ($j = 0; $j<10; $j++) { |
|
| 128 | 128 | foreach ($keys as $k) { |
| 129 | 129 | xmlrpc_set_type($data[$j][$k][4], 'datetime'); |
| 130 | 130 | xmlrpc_set_type($data[$j][$k][8], 'datetime'); |
@@ -138,18 +138,18 @@ discard block |
||
| 138 | 138 | // test 'old style' data decoding vs. 'automatic style' decoding |
| 139 | 139 | $dummy = new Request(''); |
| 140 | 140 | $out = new Response($value); |
| 141 | -$in = '<?xml version="1.0" ?>' . "\n" . $out->serialize(); |
|
| 141 | +$in = '<?xml version="1.0" ?>'."\n".$out->serialize(); |
|
| 142 | 142 | |
| 143 | 143 | begin_test('Data decoding (large array)', 'manual decoding'); |
| 144 | -for ($i = 0; $i < $num_tests; $i++) { |
|
| 144 | +for ($i = 0; $i<$num_tests; $i++) { |
|
| 145 | 145 | $response = $dummy->ParseResponse($in, true); |
| 146 | 146 | $value = $response->value(); |
| 147 | 147 | $result = array(); |
| 148 | - foreach($value as $val1) { |
|
| 148 | + foreach ($value as $val1) { |
|
| 149 | 149 | $out = array(); |
| 150 | - foreach($val1 as $name => $val) { |
|
| 150 | + foreach ($val1 as $name => $val) { |
|
| 151 | 151 | $out[$name] = array(); |
| 152 | - foreach($val as $data) { |
|
| 152 | + foreach ($val as $data) { |
|
| 153 | 153 | $out[$name][] = $data->scalarval(); |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -159,18 +159,18 @@ discard block |
||
| 159 | 159 | end_test('Data decoding (large array)', 'manual decoding', $result); |
| 160 | 160 | |
| 161 | 161 | begin_test('Data decoding (large array)', 'manual decoding deprecated'); |
| 162 | -for ($i = 0; $i < $num_tests; $i++) { |
|
| 162 | +for ($i = 0; $i<$num_tests; $i++) { |
|
| 163 | 163 | $response = $dummy->ParseResponse($in, true); |
| 164 | 164 | $value = $response->value(); |
| 165 | 165 | $result = array(); |
| 166 | 166 | $l = $value->arraysize(); |
| 167 | - for ($k = 0; $k < $l; $k++) { |
|
| 167 | + for ($k = 0; $k<$l; $k++) { |
|
| 168 | 168 | $val1 = $value->arraymem($k); |
| 169 | 169 | $out = array(); |
| 170 | 170 | while (list($name, $val) = $val1->structeach()) { |
| 171 | 171 | $out[$name] = array(); |
| 172 | 172 | $m = $val->arraysize(); |
| 173 | - for ($j = 0; $j < $m; $j++) { |
|
| 173 | + for ($j = 0; $j<$m; $j++) { |
|
| 174 | 174 | $data = $val->arraymem($j); |
| 175 | 175 | $out[$name][] = $data->scalarval(); |
| 176 | 176 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | end_test('Data decoding (large array)', 'manual decoding deprecated', $result); |
| 182 | 182 | |
| 183 | 183 | begin_test('Data decoding (large array)', 'automatic decoding'); |
| 184 | -for ($i = 0; $i < $num_tests; $i++) { |
|
| 184 | +for ($i = 0; $i<$num_tests; $i++) { |
|
| 185 | 185 | $response = $dummy->ParseResponse($in, true, 'phpvals'); |
| 186 | 186 | $value = $response->value(); |
| 187 | 187 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | if (function_exists('xmlrpc_decode')) { |
| 191 | 191 | begin_test('Data decoding (large array)', 'xmlrpc-epi decoding'); |
| 192 | - for ($i = 0; $i < $num_tests; $i++) { |
|
| 192 | + for ($i = 0; $i<$num_tests; $i++) { |
|
| 193 | 193 | $response = $dummy->ParseResponse($in, true, 'xml'); |
| 194 | 194 | $value = xmlrpc_decode($response->value()); |
| 195 | 195 | } |
@@ -203,15 +203,15 @@ discard block |
||
| 203 | 203 | $value = $encoder->encode($data1, array('auto_dates')); |
| 204 | 204 | $req = new Request('interopEchoTests.echoValue', array($value)); |
| 205 | 205 | $reqs = array(); |
| 206 | - for ($i = 0; $i < 25; $i++) { |
|
| 206 | + for ($i = 0; $i<25; $i++) { |
|
| 207 | 207 | $reqs[] = $req; |
| 208 | 208 | } |
| 209 | 209 | $server = explode(':', $args['LOCALSERVER']); |
| 210 | - if (count($server) > 1) { |
|
| 211 | - $srv = $server[1] . '://' . $server[0] . $args['URI']; |
|
| 210 | + if (count($server)>1) { |
|
| 211 | + $srv = $server[1].'://'.$server[0].$args['URI']; |
|
| 212 | 212 | $c = new Client($args['URI'], $server[0], $server[1]); |
| 213 | 213 | } else { |
| 214 | - $srv = $args['LOCALSERVER'] . $args['URI']; |
|
| 214 | + $srv = $args['LOCALSERVER'].$args['URI']; |
|
| 215 | 215 | $c = new Client($args['URI'], $args['LOCALSERVER']); |
| 216 | 216 | } |
| 217 | 217 | // do not interfere with http compression |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | begin_test($testName, 'http 10'); |
| 227 | 227 | $response = array(); |
| 228 | - for ($i = 0; $i < 25; $i++) { |
|
| 228 | + for ($i = 0; $i<25; $i++) { |
|
| 229 | 229 | $resp = $c->send($req); |
| 230 | 230 | $response[] = $resp->value(); |
| 231 | 231 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | if (function_exists('curl_init')) { |
| 235 | 235 | begin_test($testName, 'http 11 w. keep-alive'); |
| 236 | 236 | $response = array(); |
| 237 | - for ($i = 0; $i < 25; $i++) { |
|
| 237 | + for ($i = 0; $i<25; $i++) { |
|
| 238 | 238 | $resp = $c->send($req, 10, 'http11'); |
| 239 | 239 | $response[] = $resp->value(); |
| 240 | 240 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $c->keepalive = false; |
| 244 | 244 | begin_test($testName, 'http 11'); |
| 245 | 245 | $response = array(); |
| 246 | - for ($i = 0; $i < 25; $i++) { |
|
| 246 | + for ($i = 0; $i<25; $i++) { |
|
| 247 | 247 | $resp = $c->send($req, 10, 'http11'); |
| 248 | 248 | $response[] = $resp->value(); |
| 249 | 249 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | begin_test($testName, 'http 10 w. compression'); |
| 265 | 265 | $response = array(); |
| 266 | - for ($i = 0; $i < 25; $i++) { |
|
| 266 | + for ($i = 0; $i<25; $i++) { |
|
| 267 | 267 | $resp = $c->send($req); |
| 268 | 268 | $response[] = $resp->value(); |
| 269 | 269 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | if (function_exists('curl_init')) { |
| 273 | 273 | begin_test($testName, 'http 11 w. keep-alive and compression'); |
| 274 | 274 | $response = array(); |
| 275 | - for ($i = 0; $i < 25; $i++) { |
|
| 275 | + for ($i = 0; $i<25; $i++) { |
|
| 276 | 276 | $resp = $c->send($req, 10, 'http11'); |
| 277 | 277 | $response[] = $resp->value(); |
| 278 | 278 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $c->keepalive = false; |
| 282 | 282 | begin_test($testName, 'http 11 w. compression'); |
| 283 | 283 | $response = array(); |
| 284 | - for ($i = 0; $i < 25; $i++) { |
|
| 284 | + for ($i = 0; $i<25; $i++) { |
|
| 285 | 285 | $resp = $c->send($req, 10, 'http11'); |
| 286 | 286 | $response[] = $resp->value(); |
| 287 | 287 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | foreach ($test_results as $test => $results) { |
| 303 | 303 | echo "\nTEST: $test\n"; |
| 304 | 304 | foreach ($results as $case => $data) { |
| 305 | - echo " $case: {$data['time']} secs - Output data CRC: " . crc32(serialize($data['result'])) . "\n"; |
|
| 305 | + echo " $case: {$data['time']} secs - Output data CRC: ".crc32(serialize($data['result']))."\n"; |
|
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | if (isset($argv)) { |
| 42 | 42 | foreach ($argv as $param) { |
| 43 | 43 | $param = explode('=', $param); |
| 44 | - if (count($param) > 1) { |
|
| 44 | + if (count($param)>1) { |
|
| 45 | 45 | $pname = strtoupper(ltrim($param[0], '-')); |
| 46 | 46 | $$pname = $param[1]; |
| 47 | 47 | } |
@@ -72,18 +72,18 @@ discard block |
||
| 72 | 72 | $args['HTTPSURI'] = $HTTPSURI; |
| 73 | 73 | } |
| 74 | 74 | if (isset($HTTPSIGNOREPEER)) { |
| 75 | - $args['HTTPSIGNOREPEER'] = (bool)$HTTPSIGNOREPEER; |
|
| 75 | + $args['HTTPSIGNOREPEER'] = (bool) $HTTPSIGNOREPEER; |
|
| 76 | 76 | } |
| 77 | 77 | if (isset($HTTPSVERIFYHOST)) { |
| 78 | - $args['HTTPSVERIFYHOST'] = (int)$HTTPSVERIFYHOST; |
|
| 78 | + $args['HTTPSVERIFYHOST'] = (int) $HTTPSVERIFYHOST; |
|
| 79 | 79 | } |
| 80 | 80 | if (isset($SSLVERSION)) { |
| 81 | - $args['SSLVERSION'] = (int)$SSLVERSION; |
|
| 81 | + $args['SSLVERSION'] = (int) $SSLVERSION; |
|
| 82 | 82 | } |
| 83 | 83 | if (isset($PROXY)) { |
| 84 | 84 | $arr = explode(':', $PROXY); |
| 85 | 85 | $args['PROXYSERVER'] = $arr[0]; |
| 86 | - if (count($arr) > 1) { |
|
| 86 | + if (count($arr)>1) { |
|
| 87 | 87 | $args['PROXYPORT'] = $arr[1]; |
| 88 | 88 | } else { |
| 89 | 89 | $args['PROXYPORT'] = 8080; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | if ($URI[0] != '/') { |
| 115 | - $URI = '/' . $URI; |
|
| 115 | + $URI = '/'.$URI; |
|
| 116 | 116 | } |
| 117 | 117 | $args['URI'] = $URI; |
| 118 | 118 | if (isset($LOCALPATH)) { |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * @license code licensed under the BSD License: see file license.txt |
| 7 | 7 | **/ |
| 8 | 8 | |
| 9 | -$coverageFile = realpath(__DIR__ . "/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
| 9 | +$coverageFile = realpath(__DIR__."/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
| 10 | 10 | |
| 11 | 11 | // has to be the same value as used in server.php |
| 12 | 12 | $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage'; |
@@ -96,14 +96,16 @@ |
||
| 96 | 96 | |
| 97 | 97 | $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
| 98 | 98 | |
| 99 | - if ($this->args['DEBUG'] == 1) |
|
| 100 | - ob_start(); |
|
| 99 | + if ($this->args['DEBUG'] == 1) { |
|
| 100 | + ob_start(); |
|
| 101 | + } |
|
| 101 | 102 | } |
| 102 | 103 | |
| 103 | 104 | protected function tearDown() |
| 104 | 105 | { |
| 105 | - if ($this->args['DEBUG'] != 1) |
|
| 106 | - return; |
|
| 106 | + if ($this->args['DEBUG'] != 1) { |
|
| 107 | + return; |
|
| 108 | + } |
|
| 107 | 109 | $out = ob_get_clean(); |
| 108 | 110 | $status = $this->getStatus(); |
| 109 | 111 | if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * @param PhpXmlRpc\Request|array $msg |
| 117 | - * @param int|array $errorCode |
|
| 117 | + * @param integer $errorCode |
|
| 118 | 118 | * @param bool $returnResponse |
| 119 | 119 | * @return mixed|\PhpXmlRpc\Response|\PhpXmlRpc\Response[]|\PhpXmlRpc\Value|string|void |
| 120 | 120 | */ |
@@ -419,6 +419,10 @@ discard block |
||
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | + /** |
|
| 423 | + * @param string $method |
|
| 424 | + * @param PhpXmlRpc\Value[] $params |
|
| 425 | + */ |
|
| 422 | 426 | public function _multicall_msg($method, $params) |
| 423 | 427 | { |
| 424 | 428 | $struct['methodName'] = new xmlrpcval($method, 'string'); |
@@ -1,9 +1,9 @@ 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 | 8 | /** |
| 9 | 9 | * Tests which involve interaction between the client and the server. |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | // (but only if not called from subclass objects / multitests) |
| 33 | 33 | if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') { |
| 34 | 34 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
| 35 | - for ($i = 0; $i < count($trace); $i++) { |
|
| 35 | + for ($i = 0; $i<count($trace); $i++) { |
|
| 36 | 36 | if (strpos($trace[$i]['function'], 'test') === 0) { |
| 37 | 37 | self::$failed_tests[$trace[$i]['function']] = true; |
| 38 | 38 | break; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function run(PHPUnit_Framework_TestResult $result = NULL) |
| 55 | 55 | { |
| 56 | - $this->testId = get_class($this) . '__' . $this->getName(); |
|
| 56 | + $this->testId = get_class($this).'__'.$this->getName(); |
|
| 57 | 57 | |
| 58 | 58 | if ($result === NULL) { |
| 59 | 59 | $result = $this->createResult(); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $this->args = argParser::getArgs(); |
| 85 | 85 | |
| 86 | 86 | $server = explode(':', $this->args['LOCALSERVER']); |
| 87 | - if (count($server) > 1) { |
|
| 87 | + if (count($server)>1) { |
|
| 88 | 88 | $this->client = new xmlrpc_client($this->args['URI'], $server[0], $server[1]); |
| 89 | 89 | } else { |
| 90 | 90 | $this->client = new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $this->client->request_compression = $this->request_compression; |
| 95 | 95 | $this->client->accepted_compression = $this->accepted_compression; |
| 96 | 96 | |
| 97 | - $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
|
| 97 | + $this->coverageScriptUrl = 'http://'.$this->args['LOCALSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI']); |
|
| 98 | 98 | |
| 99 | 99 | if ($this->args['DEBUG'] == 1) |
| 100 | 100 | ob_start(); |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | return $r; |
| 131 | 131 | } |
| 132 | 132 | if (is_array($errorCode)) { |
| 133 | - $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 133 | + $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 134 | 134 | } else { |
| 135 | - $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 135 | + $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 136 | 136 | } |
| 137 | 137 | if (!$r->faultCode()) { |
| 138 | 138 | if ($returnResponse) { |
@@ -147,15 +147,15 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | public function testString() |
| 149 | 149 | { |
| 150 | - $sendString = "here are 3 \"entities\": < > & " . |
|
| 151 | - "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . |
|
| 152 | - " - isn't that great? \\\"hackery\\\" at it's best " . |
|
| 153 | - " also don't want to miss out on \$item[0]. " . |
|
| 154 | - "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . |
|
| 155 | - "a simple CR here" . chr(13) . |
|
| 156 | - "a simple LF here" . chr(10) . |
|
| 157 | - "and then LFCR" . chr(10) . chr(13) . |
|
| 158 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; |
|
| 150 | + $sendString = "here are 3 \"entities\": < > & ". |
|
| 151 | + "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92). |
|
| 152 | + " - isn't that great? \\\"hackery\\\" at it's best ". |
|
| 153 | + " also don't want to miss out on \$item[0]. ". |
|
| 154 | + "The real weird stuff follows: CRLF here".chr(13).chr(10). |
|
| 155 | + "a simple CR here".chr(13). |
|
| 156 | + "a simple LF here".chr(10). |
|
| 157 | + "and then LFCR".chr(10).chr(13). |
|
| 158 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; |
|
| 159 | 159 | $m = new xmlrpcmsg('examples.stringecho', array( |
| 160 | 160 | new xmlrpcval($sendString, 'string'), |
| 161 | 161 | )); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | public function testLatin1String() |
| 177 | 177 | { |
| 178 | 178 | $sendString = |
| 179 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
| 179 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne"; |
|
| 180 | 180 | $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'. |
| 181 | 181 | $sendString. |
| 182 | 182 | '</value></param></params></methodCall>'; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | public function testUtf8Method() |
| 281 | 281 | { |
| 282 | 282 | PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8'; |
| 283 | - $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array( |
|
| 283 | + $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array( |
|
| 284 | 284 | new xmlrpcval('hello') |
| 285 | 285 | )); |
| 286 | 286 | $v = $this->send($m); |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | )); |
| 303 | 303 | $v = $this->send($m); |
| 304 | 304 | if ($v) { |
| 305 | - $this->assertEquals($a + $b, $v->scalarval()); |
|
| 305 | + $this->assertEquals($a+$b, $v->scalarval()); |
|
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | )); |
| 315 | 315 | $v = $this->send($m); |
| 316 | 316 | if ($v) { |
| 317 | - $this->assertEquals(12 - 23, $v->scalarval()); |
|
| 317 | + $this->assertEquals(12-23, $v->scalarval()); |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | if ($v) { |
| 349 | 349 | $sz = $v->arraysize(); |
| 350 | 350 | $got = ''; |
| 351 | - for ($i = 0; $i < $sz; $i++) { |
|
| 351 | + for ($i = 0; $i<$sz; $i++) { |
|
| 352 | 352 | $b = $v->arraymem($i); |
| 353 | 353 | if ($b->scalarval()) { |
| 354 | 354 | $got .= '1'; |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $got = ''; |
| 412 | 412 | $expected = '37210'; |
| 413 | 413 | $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes'); |
| 414 | - foreach($expect_array as $val) { |
|
| 414 | + foreach ($expect_array as $val) { |
|
| 415 | 415 | $b = $v->structmem($val); |
| 416 | 416 | $got .= $b->me['int']; |
| 417 | 417 | } |
@@ -618,9 +618,9 @@ discard block |
||
| 618 | 618 | new xmlrpcval('whatever', 'string'), |
| 619 | 619 | )); |
| 620 | 620 | $v = $this->send($m, $GLOBALS['xmlrpcerr']['server_error']); |
| 621 | - $this->client->path = $this->args['URI'] . '?EXCEPTION_HANDLING=1'; |
|
| 621 | + $this->client->path = $this->args['URI'].'?EXCEPTION_HANDLING=1'; |
|
| 622 | 622 | $v = $this->send($m, 1); // the error code of the expected exception |
| 623 | - $this->client->path = $this->args['URI'] . '?EXCEPTION_HANDLING=2'; |
|
| 623 | + $this->client->path = $this->args['URI'].'?EXCEPTION_HANDLING=2'; |
|
| 624 | 624 | // depending on whether display_errors is ON or OFF on the server, we will get back a different error here, |
| 625 | 625 | // as php will generate an http status code of either 200 or 500... |
| 626 | 626 | $v = $this->send($m, array($GLOBALS['xmlrpcerr']['invalid_return'], $GLOBALS['xmlrpcerr']['http_error'])); |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | { |
| 830 | 830 | // make a 'deep client copy' as the original one might have many properties set |
| 831 | 831 | // also for speed only wrap one method of the whole server |
| 832 | - $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' )); |
|
| 832 | + $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/')); |
|
| 833 | 833 | if ($class == '') { |
| 834 | 834 | $this->fail('Registration of remote server failed'); |
| 835 | 835 | } else { |
@@ -864,9 +864,9 @@ discard block |
||
| 864 | 864 | $cookies = array( |
| 865 | 865 | //'c1' => array(), |
| 866 | 866 | 'c2' => array('value' => 'c2'), |
| 867 | - 'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30), |
|
| 868 | - 'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'), |
|
| 869 | - 'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
| 867 | + 'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30), |
|
| 868 | + 'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'), |
|
| 869 | + 'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
| 870 | 870 | ); |
| 871 | 871 | $cookiesval = php_xmlrpc_encode($cookies); |
| 872 | 872 | $m = new xmlrpcmsg('examples.setcookies', array($cookiesval)); |
@@ -914,10 +914,10 @@ discard block |
||
| 914 | 914 | $m = new xmlrpcmsg('examples.getcookies', array()); |
| 915 | 915 | foreach ($cookies as $cookie => $val) { |
| 916 | 916 | $this->client->setCookie($cookie, $val); |
| 917 | - $cookies[$cookie] = (string)$cookies[$cookie]; |
|
| 917 | + $cookies[$cookie] = (string) $cookies[$cookie]; |
|
| 918 | 918 | } |
| 919 | 919 | $r = $this->client->send($m, $this->timeout, $this->method); |
| 920 | - $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 920 | + $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 921 | 921 | if (!$r->faultCode()) { |
| 922 | 922 | $v = $r->value(); |
| 923 | 923 | $v = php_xmlrpc_decode($v); |
@@ -1,8 +1,8 @@ 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 | 7 | /** |
| 8 | 8 | * Tests involving requests sent to non-existing servers |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | // make sure there's no freaking catchall DNS in effect |
| 56 | 56 | $dnsinfo = dns_get_record($this->client->server); |
| 57 | 57 | if ($dnsinfo) { |
| 58 | - $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found'); |
|
| 58 | + $this->markTestSkipped('Seems like there is a catchall DNS in effect: host '.$this->client->server.' found'); |
|
| 59 | 59 | } else { |
| 60 | 60 | $this->assertEquals(5, $r->faultCode()); |
| 61 | 61 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | // now test a successful connection |
| 82 | 82 | $server = explode(':', $this->args['LOCALSERVER']); |
| 83 | - if (count($server) > 1) { |
|
| 83 | + if (count($server)>1) { |
|
| 84 | 84 | $this->client->port = $server[1]; |
| 85 | 85 | } |
| 86 | 86 | $this->client->server = $server[0]; |
@@ -20,14 +20,16 @@ |
||
| 20 | 20 | $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['LOCALSERVER'], 80); |
| 21 | 21 | $this->client->setDebug($this->args['DEBUG']); |
| 22 | 22 | |
| 23 | - if ($this->args['DEBUG'] == 1) |
|
| 24 | - ob_start(); |
|
| 23 | + if ($this->args['DEBUG'] == 1) { |
|
| 24 | + ob_start(); |
|
| 25 | + } |
|
| 25 | 26 | } |
| 26 | 27 | |
| 27 | 28 | protected function tearDown() |
| 28 | 29 | { |
| 29 | - if ($this->args['DEBUG'] != 1) |
|
| 30 | - return; |
|
| 30 | + if ($this->args['DEBUG'] != 1) { |
|
| 31 | + return; |
|
| 32 | + } |
|
| 31 | 33 | $out = ob_get_clean(); |
| 32 | 34 | $status = $this->getStatus(); |
| 33 | 35 | if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
@@ -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['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/tests/', $this->args['URI'] ); |
|
| 14 | + $this->baseUrl = $this->args['LOCALSERVER'].str_replace('/demo/server/server.php', '/tests/', $this->args['URI']); |
|
| 15 | 15 | |
| 16 | - $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
|
| 16 | + $this->coverageScriptUrl = 'http://'.$this->args['LOCALSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI']); |
|
| 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 | /** |
| 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['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['URI'] ); |
|
| 14 | + $this->baseUrl = $this->args['LOCALSERVER'].str_replace('/demo/server/server.php', '/demo/', $this->args['URI']); |
|
| 15 | 15 | |
| 16 | - $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
|
| 16 | + $this->coverageScriptUrl = 'http://'.$this->args['LOCALSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI']); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function testAgeSort() |