@@ -57,13 +57,13 @@ |
||
57 | 57 | [null, self::COMMON_INTERFACE], |
58 | 58 | ]; |
59 | 59 | if (function_exists('mcrypt_create_iv')) { |
60 | - $providers[] = ['mcrypt', self::COMMON_NAMESPACE . 'McryptPseudoRandomStringGenerator']; |
|
60 | + $providers[] = ['mcrypt', self::COMMON_NAMESPACE.'McryptPseudoRandomStringGenerator']; |
|
61 | 61 | } |
62 | 62 | if (function_exists('openssl_random_pseudo_bytes')) { |
63 | - $providers[] = ['openssl', self::COMMON_NAMESPACE . 'OpenSslPseudoRandomStringGenerator']; |
|
63 | + $providers[] = ['openssl', self::COMMON_NAMESPACE.'OpenSslPseudoRandomStringGenerator']; |
|
64 | 64 | } |
65 | 65 | if (!ini_get('open_basedir') && is_readable('/dev/urandom')) { |
66 | - $providers[] = ['urandom', self::COMMON_NAMESPACE . 'UrandomPseudoRandomStringGenerator']; |
|
66 | + $providers[] = ['urandom', self::COMMON_NAMESPACE.'UrandomPseudoRandomStringGenerator']; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $providers; |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | $fbRequests = [ |
176 | 176 | new FacebookRequest($this->fbApp, 'token', 'POST', '/photo', [ |
177 | 177 | 'message' => 'foobar', |
178 | - 'source' => new FacebookFile(__DIR__ . '/foo.txt'), |
|
178 | + 'source' => new FacebookFile(__DIR__.'/foo.txt'), |
|
179 | 179 | ]), |
180 | 180 | new FacebookRequest($this->fbApp, 'token', 'POST', '/video', [ |
181 | 181 | 'message' => 'foobar', |
182 | - 'source' => new FacebookVideo(__DIR__ . '/foo.txt'), |
|
182 | + 'source' => new FacebookVideo(__DIR__.'/foo.txt'), |
|
183 | 183 | ]), |
184 | 184 | ]; |
185 | 185 | $fbBatchRequest = new FacebookBatchRequest($this->fbApp, $fbRequests); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | list($url, $method, $headers, $body) = $this->fbClient->prepareRequestMessage($fbBatchRequest); |
189 | 189 | |
190 | - $this->assertEquals(FacebookClient::BASE_GRAPH_VIDEO_URL . '/' . Facebook::DEFAULT_GRAPH_VERSION, $url); |
|
190 | + $this->assertEquals(FacebookClient::BASE_GRAPH_VIDEO_URL.'/'.Facebook::DEFAULT_GRAPH_VERSION, $url); |
|
191 | 191 | $this->assertEquals('POST', $method); |
192 | 192 | $this->assertContains('multipart/form-data; boundary=', $headers['Content-Type']); |
193 | 193 | $this->assertContains('Content-Disposition: form-data; name="batch"', $body); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | public function testARequestWithFilesWillBeMultipart() |
211 | 211 | { |
212 | - $myFile = new FacebookFile(__DIR__ . '/foo.txt'); |
|
212 | + $myFile = new FacebookFile(__DIR__.'/foo.txt'); |
|
213 | 213 | $fbRequest = new FacebookRequest($this->fbApp, 'token', 'POST', '/foo', ['file' => $myFile]); |
214 | 214 | $response = $this->fbClient->sendRequest($fbRequest); |
215 | 215 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $this->initializeTestApp(); |
235 | 235 | |
236 | 236 | // Create a test user |
237 | - $testUserPath = '/' . FacebookTestCredentials::$appId . '/accounts/test-users'; |
|
237 | + $testUserPath = '/'.FacebookTestCredentials::$appId.'/accounts/test-users'; |
|
238 | 238 | $params = [ |
239 | 239 | 'installed' => true, |
240 | 240 | 'name' => 'Foo Phpunit User', |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | static::$testFacebookApp, |
273 | 273 | static::$testFacebookApp->getAccessToken(), |
274 | 274 | 'DELETE', |
275 | - '/' . $testUserId |
|
275 | + '/'.$testUserId |
|
276 | 276 | ); |
277 | 277 | $graphNode = static::$testFacebookClient->sendRequest($request)->getGraphNode(); |
278 | 278 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | |
282 | 282 | public function initializeTestApp() |
283 | 283 | { |
284 | - if (!file_exists(__DIR__ . '/FacebookTestCredentials.php')) { |
|
284 | + if (!file_exists(__DIR__.'/FacebookTestCredentials.php')) { |
|
285 | 285 | throw new FacebookSDKException( |
286 | 286 | 'You must create a FacebookTestCredentials.php file from FacebookTestCredentials.php.dist' |
287 | 287 | ); |
@@ -23,11 +23,11 @@ |
||
23 | 23 | */ |
24 | 24 | date_default_timezone_set('Europe/Paris'); |
25 | 25 | |
26 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
26 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
27 | 27 | |
28 | 28 | use Facebook\FacebookClient; |
29 | 29 | |
30 | 30 | // Delete the temp test user after all tests have fired |
31 | -register_shutdown_function(function () { |
|
31 | +register_shutdown_function(function() { |
|
32 | 32 | //echo "\nTotal requests made to Graph: " . FacebookClient::$requestCount . "\n\n"; |
33 | 33 | }); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $accessToken = new AccessToken('foo_token'); |
34 | 34 | |
35 | 35 | $this->assertEquals('foo_token', $accessToken->getValue()); |
36 | - $this->assertEquals('foo_token', (string)$accessToken); |
|
36 | + $this->assertEquals('foo_token', (string) $accessToken); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function testAnAppSecretProofWillBeProperlyGenerated() |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | |
101 | 101 | $newAccessToken = unserialize(serialize($accessToken)); |
102 | 102 | |
103 | - $this->assertEquals((string)$accessToken, (string)$newAccessToken); |
|
103 | + $this->assertEquals((string) $accessToken, (string) $newAccessToken); |
|
104 | 104 | $this->assertEquals($accessToken->getExpiresAt(), $newAccessToken->getExpiresAt()); |
105 | 105 | } |
106 | 106 | |
107 | 107 | private function aWeekFromNow() |
108 | 108 | { |
109 | - return time() + (60 * 60 * 24 * 7);//a week from now |
|
109 | + return time() + (60 * 60 * 24 * 7); //a week from now |
|
110 | 110 | } |
111 | 111 | } |
@@ -82,19 +82,19 @@ |
||
82 | 82 | |
83 | 83 | $this->assertContains('*', $authUrl); |
84 | 84 | |
85 | - $expectedUrl = 'https://www.facebook.com/' . static::TESTING_GRAPH_VERSION . '/dialog/oauth?'; |
|
85 | + $expectedUrl = 'https://www.facebook.com/'.static::TESTING_GRAPH_VERSION.'/dialog/oauth?'; |
|
86 | 86 | $this->assertTrue(strpos($authUrl, $expectedUrl) === 0, 'Unexpected base authorization URL returned from getAuthorizationUrl().'); |
87 | 87 | |
88 | 88 | $params = [ |
89 | 89 | 'client_id' => '123', |
90 | 90 | 'redirect_uri' => 'https://foo.bar', |
91 | 91 | 'state' => 'foo_state', |
92 | - 'sdk' => 'php-sdk-' . Facebook::VERSION, |
|
92 | + 'sdk' => 'php-sdk-'.Facebook::VERSION, |
|
93 | 93 | 'scope' => implode(',', $scope), |
94 | 94 | 'foo' => 'bar', |
95 | 95 | ]; |
96 | 96 | foreach ($params as $key => $value) { |
97 | - $this->assertContains($key . '=' . urlencode($value), $authUrl); |
|
97 | + $this->assertContains($key.'='.urlencode($value), $authUrl); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | 'client_id' => '123', |
65 | 65 | 'redirect_uri' => self::REDIRECT_URL, |
66 | 66 | 'state' => $this->persistentDataHandler->get('state'), |
67 | - 'sdk' => 'php-sdk-' . Facebook::VERSION, |
|
67 | + 'sdk' => 'php-sdk-'.Facebook::VERSION, |
|
68 | 68 | 'scope' => implode(',', $scope), |
69 | 69 | ]; |
70 | 70 | foreach ($params as $key => $value) { |
71 | - $this->assertContains($key . '=' . urlencode($value), $loginUrl); |
|
71 | + $this->assertContains($key.'='.urlencode($value), $loginUrl); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ]; |
85 | 85 | foreach ($params as $key => $value) { |
86 | 86 | $this->assertTrue( |
87 | - strpos($logoutUrl, $key . '=' . urlencode($value)) !== false |
|
87 | + strpos($logoutUrl, $key.'='.urlencode($value)) !== false |
|
88 | 88 | ); |
89 | 89 | } |
90 | 90 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $accessToken = $this->redirectLoginHelper->getAccessToken(self::REDIRECT_URL); |
99 | 99 | |
100 | - $this->assertEquals('foo_token_from_code|foo_code|' . self::REDIRECT_URL, (string)$accessToken); |
|
100 | + $this->assertEquals('foo_token_from_code|foo_code|'.self::REDIRECT_URL, (string) $accessToken); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | public function testACustomCsprsgCanBeInjected() |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | if ($this->respondWith == 'FAIL_ON_START') { |
60 | 60 | return new GraphRawResponse( |
61 | 61 | "HTTP/1.1 500 OK\r\nFoo: Bar", |
62 | - '{"error":{"message":"Error validating access token: Session has expired on Monday, ' . |
|
63 | - '10-Aug-15 01:00:00 PDT. The current time is Monday, 10-Aug-15 01:14:23 PDT.",' . |
|
62 | + '{"error":{"message":"Error validating access token: Session has expired on Monday, '. |
|
63 | + '10-Aug-15 01:00:00 PDT. The current time is Monday, 10-Aug-15 01:14:23 PDT.",'. |
|
64 | 64 | '"type":"OAuthException","code":190,"error_subcode":463}}' |
65 | 65 | ); |
66 | 66 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if ($this->respondWith == 'FAIL_ON_TRANSFER') { |
77 | 77 | return new GraphRawResponse( |
78 | 78 | "HTTP/1.1 500 OK\r\nFoo: Bar", |
79 | - '{"error":{"message":"There was a problem uploading your video. Please try uploading it again.",' . |
|
79 | + '{"error":{"message":"There was a problem uploading your video. Please try uploading it again.",'. |
|
80 | 80 | '"type":"FacebookApiException","code":6000,"error_subcode":1363019}}' |
81 | 81 | ); |
82 | 82 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | $params = $request->getParams(); |
45 | 45 | $rawResponse = json_encode([ |
46 | - 'access_token' => 'foo_access_token_from:' . $params['code'], |
|
46 | + 'access_token' => 'foo_access_token_from:'.$params['code'], |
|
47 | 47 | ]); |
48 | 48 | |
49 | 49 | return new FacebookResponse($request, $rawResponse, 200); |
@@ -29,6 +29,6 @@ |
||
29 | 29 | { |
30 | 30 | public function getAccessTokenFromCode($code, $redirectUri = '', $machineId = null) |
31 | 31 | { |
32 | - return 'foo_token_from_code|' . $code . '|' . $redirectUri; |
|
32 | + return 'foo_token_from_code|'.$code.'|'.$redirectUri; |
|
33 | 33 | } |
34 | 34 | } |