@@ -40,7 +40,6 @@ public function testHttpBasicWithPassword(): void
40
40
41
41
$ serverRequest = (new ServerRequest ())->withHeader ('Authorization ' , 'Basic ' . base64_encode ('Open:Sesame ' ));
42
42
$ basicAuthMethod = $ abstractGrantReflection ->getMethod ('getBasicAuthCredentials ' );
43
- $ basicAuthMethod ->setAccessible (true );
44
43
45
44
self ::assertSame (['Open ' , 'Sesame ' ], $ basicAuthMethod ->invoke ($ grantMock , $ serverRequest ));
46
45
}
@@ -54,7 +53,6 @@ public function testHttpBasicNoPassword(): void
54
53
55
54
$ serverRequest = (new ServerRequest ())->withHeader ('Authorization ' , 'Basic ' . base64_encode ('Open: ' ));
56
55
$ basicAuthMethod = $ abstractGrantReflection ->getMethod ('getBasicAuthCredentials ' );
57
- $ basicAuthMethod ->setAccessible (true );
58
56
59
57
self ::assertSame (['Open ' , '' ], $ basicAuthMethod ->invoke ($ grantMock , $ serverRequest ));
60
58
}
@@ -68,7 +66,6 @@ public function testHttpBasicNotBasic(): void
68
66
69
67
$ serverRequest = (new ServerRequest ())->withHeader ('Authorization ' , 'Foo ' . base64_encode ('Open:Sesame ' ));
70
68
$ basicAuthMethod = $ abstractGrantReflection ->getMethod ('getBasicAuthCredentials ' );
71
- $ basicAuthMethod ->setAccessible (true );
72
69
73
70
self ::assertSame ([null , null ], $ basicAuthMethod ->invoke ($ grantMock , $ serverRequest ));
74
71
}
@@ -82,7 +79,6 @@ public function testHttpBasicCaseInsensitive(): void
82
79
83
80
$ serverRequest = (new ServerRequest ())->withHeader ('Authorization ' , 'bAsIc ' . base64_encode ('Open:Sesame ' ));
84
81
$ basicAuthMethod = $ abstractGrantReflection ->getMethod ('getBasicAuthCredentials ' );
85
- $ basicAuthMethod ->setAccessible (true );
86
82
87
83
self ::assertSame (['Open ' , 'Sesame ' ], $ basicAuthMethod ->invoke ($ grantMock , $ serverRequest ));
88
84
}
@@ -96,7 +92,6 @@ public function testHttpBasicNotBase64(): void
96
92
97
93
$ serverRequest = (new ServerRequest ())->withHeader ('Authorization ' , 'Basic || ' );
98
94
$ basicAuthMethod = $ abstractGrantReflection ->getMethod ('getBasicAuthCredentials ' );
99
- $ basicAuthMethod ->setAccessible (true );
100
95
101
96
self ::assertSame ([null , null ], $ basicAuthMethod ->invoke ($ grantMock , $ serverRequest ));
102
97
}
@@ -110,7 +105,6 @@ public function testHttpBasicNoColon(): void
110
105
111
106
$ serverRequest = (new ServerRequest ())->withHeader ('Authorization ' , 'Basic ' . base64_encode ('OpenSesame ' ));
112
107
$ basicAuthMethod = $ abstractGrantReflection ->getMethod ('getBasicAuthCredentials ' );
113
- $ basicAuthMethod ->setAccessible (true );
114
108
115
109
self ::assertSame ([null , null ], $ basicAuthMethod ->invoke ($ grantMock , $ serverRequest ));
116
110
}
@@ -141,7 +135,6 @@ public function testGetClientCredentialsClientSecretNotAString(): void
141
135
]
142
136
);
143
137
$ getClientCredentialsMethod = $ abstractGrantReflection ->getMethod ('getClientCredentials ' );
144
- $ getClientCredentialsMethod ->setAccessible (true );
145
138
146
139
$ this ->expectException (OAuthServerException::class);
147
140
@@ -170,7 +163,6 @@ public function testValidateClientPublic(): void
170
163
]);
171
164
172
165
$ validateClientMethod = $ abstractGrantReflection ->getMethod ('validateClient ' );
173
- $ validateClientMethod ->setAccessible (true );
174
166
175
167
$ result = $ validateClientMethod ->invoke ($ grantMock , $ serverRequest );
176
168
self ::assertEquals ($ client , $ result );
@@ -200,7 +192,6 @@ public function testValidateClientConfidential(): void
200
192
]);
201
193
202
194
$ validateClientMethod = $ abstractGrantReflection ->getMethod ('validateClient ' );
203
- $ validateClientMethod ->setAccessible (true );
204
195
205
196
$ result = $ validateClientMethod ->invoke ($ grantMock , $ serverRequest , true , true );
206
197
self ::assertEquals ($ client , $ result );
@@ -221,7 +212,6 @@ public function testValidateClientMissingClientId(): void
221
212
222
213
$ serverRequest = new ServerRequest ();
223
214
$ validateClientMethod = $ abstractGrantReflection ->getMethod ('validateClient ' );
224
- $ validateClientMethod ->setAccessible (true );
225
215
226
216
$ this ->expectException (OAuthServerException::class);
227
217
@@ -245,7 +235,6 @@ public function testValidateClientMissingClientSecret(): void
245
235
]);
246
236
247
237
$ validateClientMethod = $ abstractGrantReflection ->getMethod ('validateClient ' );
248
- $ validateClientMethod ->setAccessible (true );
249
238
250
239
$ this ->expectException (OAuthServerException::class);
251
240
@@ -270,7 +259,6 @@ public function testValidateClientInvalidClientSecret(): void
270
259
]);
271
260
272
261
$ validateClientMethod = $ abstractGrantReflection ->getMethod ('validateClient ' );
273
- $ validateClientMethod ->setAccessible (true );
274
262
275
263
$ this ->expectException (OAuthServerException::class);
276
264
@@ -295,7 +283,6 @@ public function testValidateClientBadClient(): void
295
283
]);
296
284
297
285
$ validateClientMethod = $ abstractGrantReflection ->getMethod ('validateClient ' );
298
- $ validateClientMethod ->setAccessible (true );
299
286
300
287
$ this ->expectException (OAuthServerException::class);
301
288
@@ -333,7 +320,6 @@ public function testIssueRefreshToken(): void
333
320
334
321
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
335
322
$ issueRefreshTokenMethod = $ abstractGrantReflection ->getMethod ('issueRefreshToken ' );
336
- $ issueRefreshTokenMethod ->setAccessible (true );
337
323
338
324
$ accessToken = new AccessTokenEntity ();
339
325
$ accessToken ->setClient (new ClientEntity ());
@@ -360,7 +346,6 @@ public function testIssueNullRefreshToken(): void
360
346
361
347
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
362
348
$ issueRefreshTokenMethod = $ abstractGrantReflection ->getMethod ('issueRefreshToken ' );
363
- $ issueRefreshTokenMethod ->setAccessible (true );
364
349
365
350
$ accessToken = new AccessTokenEntity ();
366
351
$ accessToken ->setClient (new ClientEntity ());
@@ -387,7 +372,6 @@ public function testIssueNullRefreshTokenUnauthorizedClient(): void
387
372
388
373
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
389
374
$ issueRefreshTokenMethod = $ abstractGrantReflection ->getMethod ('issueRefreshToken ' );
390
- $ issueRefreshTokenMethod ->setAccessible (true );
391
375
392
376
$ accessToken = new AccessTokenEntity ();
393
377
$ accessToken ->setClient ($ client );
@@ -408,7 +392,6 @@ public function testIssueAccessToken(): void
408
392
409
393
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
410
394
$ issueAccessTokenMethod = $ abstractGrantReflection ->getMethod ('issueAccessToken ' );
411
- $ issueAccessTokenMethod ->setAccessible (true );
412
395
413
396
/** @var AccessTokenEntityInterface $accessToken */
414
397
$ accessToken = $ issueAccessTokenMethod ->invoke (
@@ -434,7 +417,6 @@ public function testIssueAuthCode(): void
434
417
435
418
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
436
419
$ issueAuthCodeMethod = $ abstractGrantReflection ->getMethod ('issueAuthCode ' );
437
- $ issueAuthCodeMethod ->setAccessible (true );
438
420
439
421
$ scope = new ScopeEntity ();
440
422
$ scope ->setIdentifier ('scopeId ' );
@@ -460,7 +442,6 @@ public function testGetCookieParameter(): void
460
442
461
443
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
462
444
$ method = $ abstractGrantReflection ->getMethod ('getCookieParameter ' );
463
- $ method ->setAccessible (true );
464
445
465
446
$ serverRequest = (new ServerRequest ())->withCookieParams ([
466
447
'foo ' => 'bar ' ,
@@ -478,7 +459,6 @@ public function testGetQueryStringParameter(): void
478
459
479
460
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
480
461
$ method = $ abstractGrantReflection ->getMethod ('getQueryStringParameter ' );
481
- $ method ->setAccessible (true );
482
462
483
463
$ serverRequest = (new ServerRequest ())->withQueryParams ([
484
464
'foo ' => 'bar ' ,
@@ -525,7 +505,6 @@ public function testGenerateUniqueIdentifier(): void
525
505
526
506
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
527
507
$ method = $ abstractGrantReflection ->getMethod ('generateUniqueIdentifier ' );
528
- $ method ->setAccessible (true );
529
508
530
509
self ::assertIsString ($ method ->invoke ($ grantMock ));
531
510
}
@@ -580,7 +559,6 @@ public function testUnauthorizedClient(): void
580
559
$ abstractGrantReflection = new ReflectionClass ($ grantMock );
581
560
582
561
$ getClientEntityOrFailMethod = $ abstractGrantReflection ->getMethod ('getClientEntityOrFail ' );
583
- $ getClientEntityOrFailMethod ->setAccessible (true );
584
562
585
563
$ this ->expectException (OAuthServerException::class);
586
564
0 commit comments