2121use OAuth2 \OAuth2AuthenticateException ;
2222use Symfony \Component \HttpFoundation \Request ;
2323use Symfony \Component \HttpFoundation \Response ;
24- use Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface ;
2524use Symfony \Component \Security \Core \Exception \AuthenticationException ;
2625use Symfony \Component \Security \Core \Exception \CredentialsExpiredException ;
2726use Symfony \Component \Security \Core \Exception \DisabledException ;
@@ -44,11 +43,6 @@ class OAuthAuthenticatorTest extends \PHPUnit\Framework\TestCase
4443 */
4544 protected $ serverService ;
4645
47- /**
48- * @var \PHPUnit\Framework\MockObject\MockObject|TokenStorageInterface
49- */
50- protected $ tokenStorage ;
51-
5246 /**
5347 * @var \PHPUnit\Framework\MockObject\MockObject|User
5448 */
@@ -75,7 +69,6 @@ public function setUp(): void
7569 ])
7670 ->getMock ()
7771 ;
78- $ this ->tokenStorage = $ this ->getMockBuilder (TokenStorageInterface::class)->disableOriginalConstructor ()->getMock ();
7972 $ this ->userChecker = $ this ->getMockBuilder (UserCheckerInterface::class)->disableOriginalConstructor ()->getMock ();
8073 $ this ->userProvider = $ this ->getMockBuilder (UserProviderInterface::class)->disableOriginalConstructor ()->getMock ();
8174
@@ -85,7 +78,6 @@ public function setUp(): void
8578
8679 $ this ->authenticator = new OAuthAuthenticator (
8780 $ this ->serverService ,
88- $ this ->tokenStorage ,
8981 $ this ->userChecker ,
9082 $ this ->userProvider
9183 );
@@ -263,12 +255,6 @@ public function testCreateAuthenticatedTokenWithValidPassport(): void
263255 ->will ($ this ->returnValue (['ROLE_USER ' ]))
264256 ;
265257
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-
272258 // configure the passport
273259 $ passport = new Passport (
274260 new UserBadge ('test_user ' ),
0 commit comments