@@ -440,7 +440,7 @@ public function testLogClientInNoTokenPasswordWith2fa(): void {
440440 ->method ('getRemoteAddress ' )
441441 ->willReturn ('192.168.0.1 ' );
442442 $ this ->throttler
443- ->expects ($ this ->once ( ))
443+ ->expects ($ this ->exactly ( 2 ))
444444 ->method ('sleepDelayOrThrowOnMax ' )
445445 ->with ('192.168.0.1 ' );
446446 $ this ->throttler
@@ -449,6 +449,15 @@ public function testLogClientInNoTokenPasswordWith2fa(): void {
449449 ->with ('192.168.0.1 ' )
450450 ->willReturn (0 );
451451
452+ $ this ->throttler
453+ ->expects ($ this ->once ())
454+ ->method ('registerAttempt ' )
455+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
456+ $ this ->dispatcher
457+ ->expects ($ this ->once ())
458+ ->method ('dispatchTyped ' )
459+ ->with (new LoginFailed ('john ' , 'doe ' ));
460+
452461 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
453462 }
454463
@@ -551,7 +560,7 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
551560 ->method ('getRemoteAddress ' )
552561 ->willReturn ('192.168.0.1 ' );
553562 $ this ->throttler
554- ->expects ($ this ->once ( ))
563+ ->expects ($ this ->exactly ( 2 ))
555564 ->method ('sleepDelayOrThrowOnMax ' )
556565 ->with ('192.168.0.1 ' );
557566 $ this ->throttler
@@ -560,6 +569,15 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
560569 ->with ('192.168.0.1 ' )
561570 ->willReturn (0 );
562571
572+ $ this ->throttler
573+ ->expects ($ this ->once ())
574+ ->method ('registerAttempt ' )
575+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
576+ $ this ->dispatcher
577+ ->expects ($ this ->once ())
578+ ->method ('dispatchTyped ' )
579+ ->with (new LoginFailed ('john ' , 'doe ' ));
580+
563581 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
564582 }
565583
0 commit comments