@@ -442,7 +442,7 @@ public function testLogClientInNoTokenPasswordWith2fa() {
442442 ->method ('getRemoteAddress ' )
443443 ->willReturn ('192.168.0.1 ' );
444444 $ this ->throttler
445- ->expects ($ this ->once ( ))
445+ ->expects ($ this ->exactly ( 2 ))
446446 ->method ('sleepDelayOrThrowOnMax ' )
447447 ->with ('192.168.0.1 ' );
448448 $ this ->throttler
@@ -451,6 +451,15 @@ public function testLogClientInNoTokenPasswordWith2fa() {
451451 ->with ('192.168.0.1 ' )
452452 ->willReturn (0 );
453453
454+ $ this ->throttler
455+ ->expects ($ this ->once ())
456+ ->method ('registerAttempt ' )
457+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
458+ $ this ->dispatcher
459+ ->expects ($ this ->once ())
460+ ->method ('dispatchTyped ' )
461+ ->with (new LoginFailed ('john ' , 'doe ' ));
462+
454463 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
455464 }
456465
@@ -554,7 +563,7 @@ public function testLogClientInNoTokenPasswordNo2fa() {
554563 ->method ('getRemoteAddress ' )
555564 ->willReturn ('192.168.0.1 ' );
556565 $ this ->throttler
557- ->expects ($ this ->once ( ))
566+ ->expects ($ this ->exactly ( 2 ))
558567 ->method ('sleepDelayOrThrowOnMax ' )
559568 ->with ('192.168.0.1 ' );
560569 $ this ->throttler
@@ -563,6 +572,15 @@ public function testLogClientInNoTokenPasswordNo2fa() {
563572 ->with ('192.168.0.1 ' )
564573 ->willReturn (0 );
565574
575+ $ this ->throttler
576+ ->expects ($ this ->once ())
577+ ->method ('registerAttempt ' )
578+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
579+ $ this ->dispatcher
580+ ->expects ($ this ->once ())
581+ ->method ('dispatchTyped ' )
582+ ->with (new LoginFailed ('john ' , 'doe ' ));
583+
566584 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
567585 }
568586
0 commit comments