@@ -439,7 +439,7 @@ public function testLogClientInNoTokenPasswordWith2fa(): void {
439439 ->method ('getRemoteAddress ' )
440440 ->willReturn ('192.168.0.1 ' );
441441 $ this ->throttler
442- ->expects ($ this ->once ( ))
442+ ->expects ($ this ->exactly ( 2 ))
443443 ->method ('sleepDelayOrThrowOnMax ' )
444444 ->with ('192.168.0.1 ' );
445445 $ this ->throttler
@@ -448,6 +448,15 @@ public function testLogClientInNoTokenPasswordWith2fa(): void {
448448 ->with ('192.168.0.1 ' )
449449 ->willReturn (0 );
450450
451+ $ this ->throttler
452+ ->expects ($ this ->once ())
453+ ->method ('registerAttempt ' )
454+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
455+ $ this ->dispatcher
456+ ->expects ($ this ->once ())
457+ ->method ('dispatchTyped ' )
458+ ->with (new LoginFailed ('john ' , 'doe ' ));
459+
451460 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
452461 }
453462
@@ -550,7 +559,7 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
550559 ->method ('getRemoteAddress ' )
551560 ->willReturn ('192.168.0.1 ' );
552561 $ this ->throttler
553- ->expects ($ this ->once ( ))
562+ ->expects ($ this ->exactly ( 2 ))
554563 ->method ('sleepDelayOrThrowOnMax ' )
555564 ->with ('192.168.0.1 ' );
556565 $ this ->throttler
@@ -559,6 +568,15 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
559568 ->with ('192.168.0.1 ' )
560569 ->willReturn (0 );
561570
571+ $ this ->throttler
572+ ->expects ($ this ->once ())
573+ ->method ('registerAttempt ' )
574+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
575+ $ this ->dispatcher
576+ ->expects ($ this ->once ())
577+ ->method ('dispatchTyped ' )
578+ ->with (new LoginFailed ('john ' , 'doe ' ));
579+
562580 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
563581 }
564582
0 commit comments