12
12
use SocialiteProviders \Manager \Test \Stubs \OAuthTwoTestProviderStub ;
13
13
use stdClass ;
14
14
use Symfony \Component \HttpFoundation \RedirectResponse ;
15
- use Symfony \Component \HttpFoundation \Session \SessionInterface ;
16
15
17
16
class OAuthTwoTest extends TestCase
18
17
{
@@ -54,7 +53,7 @@ public function userReturnsAUserInstanceForTheAuthenticatedRequest(): void
54
53
$ session = m::mock (SessionContract::class);
55
54
$ request = Request::create ('foo ' , 'GET ' , [
56
55
'state ' => str_repeat ('A ' , 40 ),
57
- 'code ' => 'code ' ,
56
+ 'code ' => 'code ' ,
58
57
]);
59
58
$ request ->setLaravelSession ($ session );
60
59
$ session
@@ -72,11 +71,11 @@ public function userReturnsAUserInstanceForTheAuthenticatedRequest(): void
72
71
'Accept ' => 'application/json ' ,
73
72
],
74
73
'form_params ' => [
75
- 'grant_type ' => 'authorization_code ' ,
76
- 'client_id ' => 'client_id ' ,
74
+ 'grant_type ' => 'authorization_code ' ,
75
+ 'client_id ' => 'client_id ' ,
77
76
'client_secret ' => 'client_secret ' ,
78
- 'code ' => 'code ' ,
79
- 'redirect_uri ' => 'redirect_uri ' ,
77
+ 'code ' => 'code ' ,
78
+ 'redirect_uri ' => 'redirect_uri ' ,
80
79
],
81
80
])
82
81
->andReturn ($ response = m::mock (stdClass::class));
@@ -98,7 +97,7 @@ public function access_token_response_body_is_accessible_from_user(): void
98
97
$ accessTokenResponseBody = '{"access_token": "access_token", "test": "test"} ' ;
99
98
$ request = Request::create ('foo ' , 'GET ' , [
100
99
'state ' => str_repeat ('A ' , 40 ),
101
- 'code ' => 'code ' ,
100
+ 'code ' => 'code ' ,
102
101
]);
103
102
$ request ->setLaravelSession ($ session );
104
103
$ session
@@ -116,11 +115,11 @@ public function access_token_response_body_is_accessible_from_user(): void
116
115
'Accept ' => 'application/json ' ,
117
116
],
118
117
'form_params ' => [
119
- 'grant_type ' => 'authorization_code ' ,
120
- 'client_id ' => 'client_id ' ,
118
+ 'grant_type ' => 'authorization_code ' ,
119
+ 'client_id ' => 'client_id ' ,
121
120
'client_secret ' => 'client_secret ' ,
122
- 'code ' => 'code ' ,
123
- 'redirect_uri ' => 'redirect_uri ' ,
121
+ 'code ' => 'code ' ,
122
+ 'redirect_uri ' => 'redirect_uri ' ,
124
123
],
125
124
])
126
125
->andReturn ($ response = m::mock (stdClass::class));
@@ -143,7 +142,7 @@ public function regular_laravel_socialite_class_works_as_well(): void
143
142
$ accessTokenResponseBody = '{"access_token": "access_token", "test": "test"} ' ;
144
143
$ request = Request::create ('foo ' , 'GET ' , [
145
144
'state ' => str_repeat ('A ' , 40 ),
146
- 'code ' => 'code ' ,
145
+ 'code ' => 'code ' ,
147
146
]);
148
147
$ request ->setLaravelSession ($ session );
149
148
$ session
@@ -162,11 +161,11 @@ public function regular_laravel_socialite_class_works_as_well(): void
162
161
'Accept ' => 'application/json ' ,
163
162
],
164
163
'form_params ' => [
165
- 'grant_type ' => 'authorization_code ' ,
166
- 'client_id ' => 'client_id ' ,
164
+ 'grant_type ' => 'authorization_code ' ,
165
+ 'client_id ' => 'client_id ' ,
167
166
'client_secret ' => 'client_secret ' ,
168
- 'code ' => 'code ' ,
169
- 'redirect_uri ' => 'redirect_uri ' ,
167
+ 'code ' => 'code ' ,
168
+ 'redirect_uri ' => 'redirect_uri ' ,
170
169
],
171
170
])
172
171
->andReturn ($ response = m::mock (stdClass::class));
@@ -184,12 +183,12 @@ public function regular_laravel_socialite_class_works_as_well(): void
184
183
*/
185
184
public function exceptionIsThrownIfStateIsInvalid (): void
186
185
{
187
- $ this ->expectExceptionObject (new InvalidStateException () );
186
+ $ this ->expectExceptionObject (new InvalidStateException );
188
187
189
188
$ session = m::mock (SessionContract::class);
190
189
$ request = Request::create ('foo ' , 'GET ' , [
191
190
'state ' => str_repeat ('B ' , 40 ),
192
- 'code ' => 'code ' ,
191
+ 'code ' => 'code ' ,
193
192
]);
194
193
$ request ->setLaravelSession ($ session );
195
194
$ session
@@ -206,12 +205,12 @@ public function exceptionIsThrownIfStateIsInvalid(): void
206
205
*/
207
206
public function exceptionIsThrownIfStateIsNotSet (): void
208
207
{
209
- $ this ->expectExceptionObject (new InvalidStateException () );
208
+ $ this ->expectExceptionObject (new InvalidStateException );
210
209
211
210
$ session = m::mock (SessionContract::class);
212
211
$ request = Request::create ('foo ' , 'GET ' , [
213
212
'state ' => 'state ' ,
214
- 'code ' => 'code ' ,
213
+ 'code ' => 'code ' ,
215
214
]);
216
215
$ request ->setLaravelSession ($ session );
217
216
$ session
@@ -231,7 +230,7 @@ public function userObjectShouldBeCachedOnFirstCall(): void
231
230
$ accessTokenResponseBody = '{"access_token": "access_token", "test": "test"} ' ;
232
231
$ request = Request::create ('foo ' , 'GET ' , [
233
232
'state ' => str_repeat ('A ' , 40 ),
234
- 'code ' => 'code ' ,
233
+ 'code ' => 'code ' ,
235
234
]);
236
235
$ request ->setLaravelSession ($ session );
237
236
$ session
@@ -250,11 +249,11 @@ public function userObjectShouldBeCachedOnFirstCall(): void
250
249
'Accept ' => 'application/json ' ,
251
250
],
252
251
'form_params ' => [
253
- 'grant_type ' => 'authorization_code ' ,
254
- 'client_id ' => 'client_id ' ,
252
+ 'grant_type ' => 'authorization_code ' ,
253
+ 'client_id ' => 'client_id ' ,
255
254
'client_secret ' => 'client_secret ' ,
256
- 'code ' => 'code ' ,
257
- 'redirect_uri ' => 'redirect_uri ' ,
255
+ 'code ' => 'code ' ,
256
+ 'redirect_uri ' => 'redirect_uri ' ,
258
257
],
259
258
])
260
259
->andReturn ($ response = m::mock (stdClass::class));
0 commit comments