File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -461,6 +461,40 @@ public function testDoubleSetGrantExtension()
461
461
462
462
$ this ->assertEquals ($ grantExtension2 , $ grantExtensions [$ uri ]);
463
463
}
464
+
465
+ public function testMarkAuthCodeAsUsedIfAuthCodeFound ()
466
+ {
467
+ $ authCode = $ this ->getMock ('FOS\OAuthServerBundle\Model\AuthCodeInterface ' );
468
+
469
+ $ this ->authCodeManager ->expects ($ this ->atLeastOnce ())
470
+ ->method ('findAuthCodeByToken ' )
471
+ ->with ('123_abc ' )
472
+ ->will ($ this ->returnValue ($ authCode ))
473
+ ;
474
+
475
+ $ this ->authCodeManager ->expects ($ this ->atLeastOnce ())
476
+ ->method ('deleteAuthCode ' )
477
+ ->with ($ authCode )
478
+ ->will ($ this ->returnValue (null ))
479
+ ;
480
+
481
+ $ this ->storage ->markAuthCodeAsUsed ('123_abc ' );
482
+ }
483
+
484
+ public function testMarkAuthCodeAsUsedIfAuthCodeNotFound ()
485
+ {
486
+ $ this ->authCodeManager ->expects ($ this ->atLeastOnce ())
487
+ ->method ('findAuthCodeByToken ' )
488
+ ->with ('123_abc ' )
489
+ ->will ($ this ->returnValue (null ))
490
+ ;
491
+
492
+ $ this ->authCodeManager ->expects ($ this ->never ())
493
+ ->method ('deleteAuthCode ' )
494
+ ;
495
+
496
+ $ this ->storage ->markAuthCodeAsUsed ('123_abc ' );
497
+ }
464
498
}
465
499
466
500
class User implements UserInterface
You can’t perform that action at this time.
0 commit comments