@@ -130,7 +130,7 @@ public function testGetAccessToken() {
130130 $ cookieBag = new InputBag ();
131131 $ cookieBag ->set ('test_prefix_oauth_state_jwt ' , 'test jwt value ' );
132132 $ requestMock ->cookies = $ cookieBag ;
133- $ requestMock ->method ( ' get ' )-> willReturn ( $ state );
133+ $ requestMock ->query = new InputBag ([ ' state ' => $ state, ' code ' => $ state ] );
134134
135135 $ jwtEncoderMock = $ this ->createMock (JWTEncoderInterface::class);
136136 $ jwtEncoderMock ->expects ($ this ->once ())
@@ -175,7 +175,7 @@ public function testGetAccessTokenThrowsIfJWTCannotBeDecoded() {
175175 $ cookieBag = new InputBag ();
176176 $ cookieBag ->set ('test_prefix_oauth_state_jwt ' , 'test jwt value ' );
177177 $ requestMock ->cookies = $ cookieBag ;
178- $ requestMock ->method ( ' get ' )-> willReturn ( $ state );
178+ $ requestMock ->query = new InputBag ([ ' state ' => $ state, ' code ' => $ state ] );
179179
180180 $ jwtEncoderMock = $ this ->createMock (JWTEncoderInterface::class);
181181 $ jwtEncoderMock ->expects ($ this ->once ())
@@ -220,7 +220,7 @@ public function testGetAccessTokenThrowsIfJWTStateDoesNotMatch() {
220220 $ cookieBag = new InputBag ();
221221 $ cookieBag ->set ('test_prefix_oauth_state_jwt ' , 'test jwt value ' );
222222 $ requestMock ->cookies = $ cookieBag ;
223- $ requestMock ->method ( ' get ' )-> willReturn ( $ state );
223+ $ requestMock ->query = new InputBag ([ ' state ' => $ state, ' code ' => $ state ] );
224224
225225 $ jwtEncoderMock = $ this ->createMock (JWTEncoderInterface::class);
226226 $ jwtEncoderMock ->expects ($ this ->once ())
@@ -265,7 +265,7 @@ public function testGetAccessTokenThrowsIfNoMatchingStateEntryInTheDatabase() {
265265 $ cookieBag = new InputBag ();
266266 $ cookieBag ->set ('test_prefix_oauth_state_jwt ' , 'test jwt value ' );
267267 $ requestMock ->cookies = $ cookieBag ;
268- $ requestMock ->method ( ' get ' )-> willReturn ( $ state );
268+ $ requestMock ->query = new InputBag ([ ' state ' => $ state, ' code ' => $ state ] );
269269
270270 $ jwtEncoderMock = $ this ->createMock (JWTEncoderInterface::class);
271271 $ jwtEncoderMock ->expects ($ this ->once ())
@@ -311,7 +311,7 @@ public function testGetAccessTokenThrowsIfMultipleMatchingStateEntriesInTheDatab
311311 $ cookieBag = new InputBag ();
312312 $ cookieBag ->set ('test_prefix_oauth_state_jwt ' , 'test jwt value ' );
313313 $ requestMock ->cookies = $ cookieBag ;
314- $ requestMock ->method ( ' get ' )-> willReturn ( $ state );
314+ $ requestMock ->query = new InputBag ([ ' state ' => $ state, ' code ' => $ state ] );
315315
316316 $ jwtEncoderMock = $ this ->createMock (JWTEncoderInterface::class);
317317 $ jwtEncoderMock ->expects ($ this ->once ())
@@ -357,7 +357,7 @@ public function testGetAccessTokenRemovesSavedStateFromDatabase() {
357357 $ cookieBag = new InputBag ();
358358 $ cookieBag ->set ('test_prefix_oauth_state_jwt ' , 'test jwt value ' );
359359 $ requestMock ->cookies = $ cookieBag ;
360- $ requestMock ->method ( ' get ' )-> willReturn ( $ state );
360+ $ requestMock ->query = new InputBag ([ ' state ' => $ state, ' code ' => $ state ] );
361361
362362 $ jwtEncoderMock = $ this ->createMock (JWTEncoderInterface::class);
363363 $ jwtEncoderMock ->expects ($ this ->once ())
0 commit comments