@@ -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
@@ -552,7 +561,7 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
552561 ->method ('getRemoteAddress ' )
553562 ->willReturn ('192.168.0.1 ' );
554563 $ this ->throttler
555- ->expects ($ this ->once ( ))
564+ ->expects ($ this ->exactly ( 2 ))
556565 ->method ('sleepDelayOrThrowOnMax ' )
557566 ->with ('192.168.0.1 ' );
558567 $ this ->throttler
@@ -561,6 +570,15 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
561570 ->with ('192.168.0.1 ' )
562571 ->willReturn (0 );
563572
573+ $ this ->throttler
574+ ->expects ($ this ->once ())
575+ ->method ('registerAttempt ' )
576+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
577+ $ this ->dispatcher
578+ ->expects ($ this ->once ())
579+ ->method ('dispatchTyped ' )
580+ ->with (new LoginFailed ('john ' , 'doe ' ));
581+
564582 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
565583 }
566584
0 commit comments