@@ -268,6 +268,7 @@ public function testSolveChallengeInvalidProvider() {
268268
269269 public function testSolveInvalidChallenge () {
270270 $ user = $ this ->createMock (IUser::class);
271+ $ user ->method ('getUID ' )->willReturn ('myuser ' );
271272 $ provider = $ this ->createMock (IProvider::class);
272273
273274 $ this ->userSession ->expects ($ this ->once ())
@@ -297,11 +298,13 @@ public function testSolveInvalidChallenge() {
297298 ->willReturn ('myprovider ' );
298299
299300 $ expected = new RedirectResponse ('files/index/url ' );
301+ $ expected ->throttle (['user ' => 'myuser ' , 'provider ' => 'myprovider ' ]);
300302 $ this ->assertEquals ($ expected , $ this ->controller ->solveChallenge ('myprovider ' , 'token ' , '/url ' ));
301303 }
302304
303305 public function testSolveChallengeTwoFactorException () {
304306 $ user = $ this ->createMock (IUser::class);
307+ $ user ->method ('getUID ' )->willReturn ('myuser ' );
305308 $ provider = $ this ->createMock (IProvider::class);
306309 $ exception = new TwoFactorException ("2FA failed " );
307310
@@ -335,6 +338,7 @@ public function testSolveChallengeTwoFactorException() {
335338 ->willReturn ('myprovider ' );
336339
337340 $ expected = new RedirectResponse ('files/index/url ' );
341+ $ expected ->throttle (['user ' => 'myuser ' , 'provider ' => 'myprovider ' ]);
338342 $ this ->assertEquals ($ expected , $ this ->controller ->solveChallenge ('myprovider ' , 'token ' , '/url ' ));
339343 }
340344
0 commit comments