@@ -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'; |
@@ -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'; |
@@ -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]; |
@@ -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() |
@@ -2,10 +2,10 @@ 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 | 10 | /** |
11 | 11 | * Tests involving parsing of xml and handling of xmlrpc values |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | public function testUnicodeInMemberName() |
63 | 63 | { |
64 | - $str = "G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
64 | + $str = "G".chr(252)."nter, El".chr(232)."ne"; |
|
65 | 65 | $v = array($str => new xmlrpcval(1)); |
66 | 66 | $r = new xmlrpcresp(new xmlrpcval($v, 'struct')); |
67 | 67 | $r = $r->serialize(); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | <!-- $Id --> |
79 | 79 | <!-- found by G. giunta, covers what happens when lib receives |
80 | 80 | UTF8 chars in response text and comments --> |
81 | -<!-- ' . chr(224) . chr(252) . chr(232) . 'àüè --> |
|
81 | +<!-- ' . chr(224).chr(252).chr(232).'àüè --> |
|
82 | 82 | <methodResponse> |
83 | 83 | <fault> |
84 | 84 | <value> |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | </member> |
90 | 90 | <member> |
91 | 91 | <name>faultString</name> |
92 | -<value><string>' . chr(224) . chr(252) . chr(232) . 'àüè</string></value> |
|
92 | +<value><string>' . chr(224).chr(252).chr(232).'àüè</string></value> |
|
93 | 93 | </member> |
94 | 94 | </struct> |
95 | 95 | </value> |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $m = $this->newMsg('dummy'); |
99 | 99 | $r = $m->parseResponse($response); |
100 | 100 | $v = $r->faultString(); |
101 | - $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v); |
|
101 | + $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | public function testValidNumbers() |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | |
446 | 446 | public function testUTF8Response() |
447 | 447 | { |
448 | - $string = chr(224) . chr(252) . chr(232); |
|
448 | + $string = chr(224).chr(252).chr(232); |
|
449 | 449 | |
450 | 450 | $s = $this->newMsg('dummy'); |
451 | - $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> |
|
452 | -<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> |
|
451 | + $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> |
|
452 | +<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> |
|
453 | 453 | '; |
454 | 454 | $r = $s->parseResponse($f, false, 'phpvals'); |
455 | 455 | $v = $r->value(); |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | $this->assertEquals($string, $v); |
458 | 458 | |
459 | 459 | $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
460 | -<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> |
|
460 | +<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> |
|
461 | 461 | '; |
462 | 462 | $r = $s->parseResponse($f, false, 'phpvals'); |
463 | 463 | $v = $r->value(); |
@@ -472,11 +472,11 @@ discard block |
||
472 | 472 | |
473 | 473 | public function testLatin1Response() |
474 | 474 | { |
475 | - $string = chr(224) . chr(252) . chr(232); |
|
475 | + $string = chr(224).chr(252).chr(232); |
|
476 | 476 | |
477 | 477 | $s = $this->newMsg('dummy'); |
478 | - $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> |
|
479 | -<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> |
|
478 | + $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> |
|
479 | +<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> |
|
480 | 480 | '; |
481 | 481 | $r = $s->parseResponse($f, false, 'phpvals'); |
482 | 482 | $v = $r->value(); |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | $this->assertEquals($string, $v); |
485 | 485 | |
486 | 486 | $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
487 | -<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> |
|
487 | +<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> |
|
488 | 488 | '; |
489 | 489 | $r = $s->parseResponse($f, false, 'phpvals'); |
490 | 490 | $v = $r->value(); |
@@ -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() |
@@ -3,16 +3,16 @@ discard block |
||
3 | 3 | <body> |
4 | 4 | <?php |
5 | 5 | |
6 | -include_once __DIR__ . "/../vendor/autoload.php"; |
|
6 | +include_once __DIR__."/../vendor/autoload.php"; |
|
7 | 7 | |
8 | 8 | $req = new PhpXmlRpc\Request('examples.getStateName'); |
9 | 9 | |
10 | 10 | print "<h3>Testing value serialization</h3>\n"; |
11 | 11 | |
12 | 12 | $v = new PhpXmlRpc\Value(23, "int"); |
13 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
13 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
14 | 14 | $v = new PhpXmlRpc\Value("What are you saying? >> << &&"); |
15 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
15 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
16 | 16 | |
17 | 17 | $v = new PhpXmlRpc\Value(array( |
18 | 18 | new PhpXmlRpc\Value("ABCDEFHIJ"), |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | "array" |
22 | 22 | ); |
23 | 23 | |
24 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
24 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
25 | 25 | |
26 | 26 | $v = new PhpXmlRpc\Value( |
27 | 27 | array( |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | "struct" |
50 | 50 | ); |
51 | 51 | |
52 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
52 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
53 | 53 | |
54 | 54 | $w = new PhpXmlRpc\Value(array($v, new PhpXmlRpc\Value("That was the struct!")), "array"); |
55 | 55 | |
56 | -print "<PRE>" . htmlentities($w->serialize()) . "</PRE>"; |
|
56 | +print "<PRE>".htmlentities($w->serialize())."</PRE>"; |
|
57 | 57 | |
58 | 58 | $w = new PhpXmlRpc\Value("Mary had a little lamb, |
59 | 59 | Whose fleece was white as snow, |
@@ -65,26 +65,26 @@ discard block |
||
65 | 65 | Ten thousand volts went down its back |
66 | 66 | And turned it into nylon", "base64" |
67 | 67 | ); |
68 | -print "<PRE>" . htmlentities($w->serialize()) . "</PRE>"; |
|
69 | -print "<PRE>Value of base64 string is: '" . $w->scalarval() . "'</PRE>"; |
|
68 | +print "<PRE>".htmlentities($w->serialize())."</PRE>"; |
|
69 | +print "<PRE>Value of base64 string is: '".$w->scalarval()."'</PRE>"; |
|
70 | 70 | |
71 | 71 | $req->method(''); |
72 | 72 | $req->addParam(new PhpXmlRpc\Value("41", "int")); |
73 | 73 | |
74 | 74 | print "<h3>Testing request serialization</h3>\n"; |
75 | 75 | $op = $req->serialize(); |
76 | -print "<PRE>" . htmlentities($op) . "</PRE>"; |
|
76 | +print "<PRE>".htmlentities($op)."</PRE>"; |
|
77 | 77 | |
78 | 78 | print "<h3>Testing ISO date format</h3><pre>\n"; |
79 | 79 | |
80 | 80 | $t = time(); |
81 | 81 | $date = PhpXmlRpc\Helper\Date::iso8601Encode($t); |
82 | 82 | print "Now is $t --> $date\n"; |
83 | -print "Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n"; |
|
83 | +print "Or in UTC, that is ".PhpXmlRpc\Helper\Date::iso8601Encode($t, 1)."\n"; |
|
84 | 84 | $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date); |
85 | 85 | print "That is to say $date --> $tb\n"; |
86 | -print "Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n"; |
|
87 | -print "Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($date, 1) . "\n"; |
|
86 | +print "Which comes out at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb)."\n"; |
|
87 | +print "Which was the time in UTC at ".PhpXmlRpc\Helper\Date::iso8601Encode($date, 1)."\n"; |
|
88 | 88 | |
89 | 89 | print "</pre>\n"; |
90 | 90 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . "/../../vendor/autoload.php"; |
|
3 | +include_once __DIR__."/../../vendor/autoload.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 |