@@ -361,7 +361,7 @@ public function testLogClientInNoTokenPasswordWith2fa() {
361361 ->method ('getRemoteAddress ' )
362362 ->willReturn ('192.168.0.1 ' );
363363 $ this ->throttler
364- ->expects ($ this ->once ( ))
364+ ->expects ($ this ->exactly ( 2 ))
365365 ->method ('sleepDelayOrThrowOnMax ' )
366366 ->with ('192.168.0.1 ' );
367367 $ this ->throttler
@@ -370,6 +370,15 @@ public function testLogClientInNoTokenPasswordWith2fa() {
370370 ->with ('192.168.0.1 ' )
371371 ->willReturn (0 );
372372
373+ $ this ->throttler
374+ ->expects ($ this ->once ())
375+ ->method ('registerAttempt ' )
376+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
377+ $ this ->dispatcher
378+ ->expects ($ this ->once ())
379+ ->method ('dispatchTyped ' )
380+ ->with (new LoginFailed ('john ' , 'doe ' ));
381+
373382 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
374383 }
375384
@@ -473,7 +482,7 @@ public function testLogClientInNoTokenPasswordNo2fa() {
473482 ->method ('getRemoteAddress ' )
474483 ->willReturn ('192.168.0.1 ' );
475484 $ this ->throttler
476- ->expects ($ this ->once ( ))
485+ ->expects ($ this ->exactly ( 2 ))
477486 ->method ('sleepDelayOrThrowOnMax ' )
478487 ->with ('192.168.0.1 ' );
479488 $ this ->throttler
@@ -482,6 +491,15 @@ public function testLogClientInNoTokenPasswordNo2fa() {
482491 ->with ('192.168.0.1 ' )
483492 ->willReturn (0 );
484493
494+ $ this ->throttler
495+ ->expects ($ this ->once ())
496+ ->method ('registerAttempt ' )
497+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
498+ $ this ->dispatcher
499+ ->expects ($ this ->once ())
500+ ->method ('dispatchTyped ' )
501+ ->with (new LoginFailed ('john ' , 'doe ' ));
502+
485503 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
486504 }
487505
0 commit comments