@@ -441,7 +441,7 @@ public function testLogClientInNoTokenPasswordWith2fa() {
441441 ->method ('getRemoteAddress ' )
442442 ->willReturn ('192.168.0.1 ' );
443443 $ this ->throttler
444- ->expects ($ this ->once ( ))
444+ ->expects ($ this ->exactly ( 2 ))
445445 ->method ('sleepDelayOrThrowOnMax ' )
446446 ->with ('192.168.0.1 ' );
447447 $ this ->throttler
@@ -450,6 +450,15 @@ public function testLogClientInNoTokenPasswordWith2fa() {
450450 ->with ('192.168.0.1 ' )
451451 ->willReturn (0 );
452452
453+ $ this ->throttler
454+ ->expects ($ this ->once ())
455+ ->method ('registerAttempt ' )
456+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
457+ $ this ->dispatcher
458+ ->expects ($ this ->once ())
459+ ->method ('dispatchTyped ' )
460+ ->with (new LoginFailed ('john ' , 'doe ' ));
461+
453462 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
454463 }
455464
@@ -553,7 +562,7 @@ public function testLogClientInNoTokenPasswordNo2fa() {
553562 ->method ('getRemoteAddress ' )
554563 ->willReturn ('192.168.0.1 ' );
555564 $ this ->throttler
556- ->expects ($ this ->once ( ))
565+ ->expects ($ this ->exactly ( 2 ))
557566 ->method ('sleepDelayOrThrowOnMax ' )
558567 ->with ('192.168.0.1 ' );
559568 $ this ->throttler
@@ -562,6 +571,15 @@ public function testLogClientInNoTokenPasswordNo2fa() {
562571 ->with ('192.168.0.1 ' )
563572 ->willReturn (0 );
564573
574+ $ this ->throttler
575+ ->expects ($ this ->once ())
576+ ->method ('registerAttempt ' )
577+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
578+ $ this ->dispatcher
579+ ->expects ($ this ->once ())
580+ ->method ('dispatchTyped ' )
581+ ->with (new LoginFailed ('john ' , 'doe ' ));
582+
565583 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
566584 }
567585
0 commit comments