21
21
use OAuth2 \OAuth2AuthenticateException ;
22
22
use Symfony \Component \HttpFoundation \Request ;
23
23
use Symfony \Component \HttpFoundation \Response ;
24
- use Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface ;
25
24
use Symfony \Component \Security \Core \Exception \AuthenticationException ;
26
25
use Symfony \Component \Security \Core \Exception \CredentialsExpiredException ;
27
26
use Symfony \Component \Security \Core \Exception \DisabledException ;
@@ -44,11 +43,6 @@ class OAuthAuthenticatorTest extends \PHPUnit\Framework\TestCase
44
43
*/
45
44
protected $ serverService ;
46
45
47
- /**
48
- * @var \PHPUnit\Framework\MockObject\MockObject|TokenStorageInterface
49
- */
50
- protected $ tokenStorage ;
51
-
52
46
/**
53
47
* @var \PHPUnit\Framework\MockObject\MockObject|User
54
48
*/
@@ -75,7 +69,6 @@ public function setUp(): void
75
69
])
76
70
->getMock ()
77
71
;
78
- $ this ->tokenStorage = $ this ->getMockBuilder (TokenStorageInterface::class)->disableOriginalConstructor ()->getMock ();
79
72
$ this ->userChecker = $ this ->getMockBuilder (UserCheckerInterface::class)->disableOriginalConstructor ()->getMock ();
80
73
$ this ->userProvider = $ this ->getMockBuilder (UserProviderInterface::class)->disableOriginalConstructor ()->getMock ();
81
74
@@ -85,7 +78,6 @@ public function setUp(): void
85
78
86
79
$ this ->authenticator = new OAuthAuthenticator (
87
80
$ this ->serverService ,
88
- $ this ->tokenStorage ,
89
81
$ this ->userChecker ,
90
82
$ this ->userProvider
91
83
);
@@ -263,12 +255,6 @@ public function testCreateAuthenticatedTokenWithValidPassport(): void
263
255
->will ($ this ->returnValue (['ROLE_USER ' ]))
264
256
;
265
257
266
- // expect a new authenticated token to be stored
267
- $ this ->tokenStorage ->expects ($ this ->once ())
268
- ->method ('setToken ' )
269
- ->with ($ this ->isInstanceOf (OAuthToken::class))
270
- ;
271
-
272
258
// configure the passport
273
259
$ passport = new Passport (
274
260
new UserBadge ('test_user ' ),
0 commit comments