Passed
Push — master ( e3bc20...338f23 )
by Gaetano
05:26
created
tests/LocalFileTestCase.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
19 19
 
20 20
     public function _run($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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
tests/3LocalhostTest.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.