@@ -363,7 +363,7 @@ public function testLogClientInNoTokenPasswordWith2fa() {
363363 ->method ('getRemoteAddress ' )
364364 ->willReturn ('192.168.0.1 ' );
365365 $ this ->throttler
366- ->expects ($ this ->once ( ))
366+ ->expects ($ this ->exactly ( 2 ))
367367 ->method ('sleepDelayOrThrowOnMax ' )
368368 ->with ('192.168.0.1 ' );
369369 $ this ->throttler
@@ -372,6 +372,15 @@ public function testLogClientInNoTokenPasswordWith2fa() {
372372 ->with ('192.168.0.1 ' )
373373 ->willReturn (0 );
374374
375+ $ this ->throttler
376+ ->expects ($ this ->once ())
377+ ->method ('registerAttempt ' )
378+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
379+ $ this ->dispatcher
380+ ->expects ($ this ->once ())
381+ ->method ('dispatchTyped ' )
382+ ->with (new LoginFailed ('john ' , 'doe ' ));
383+
375384 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
376385 }
377386
@@ -475,7 +484,7 @@ public function testLogClientInNoTokenPasswordNo2fa() {
475484 ->method ('getRemoteAddress ' )
476485 ->willReturn ('192.168.0.1 ' );
477486 $ this ->throttler
478- ->expects ($ this ->once ( ))
487+ ->expects ($ this ->exactly ( 2 ))
479488 ->method ('sleepDelayOrThrowOnMax ' )
480489 ->with ('192.168.0.1 ' );
481490 $ this ->throttler
@@ -484,6 +493,15 @@ public function testLogClientInNoTokenPasswordNo2fa() {
484493 ->with ('192.168.0.1 ' )
485494 ->willReturn (0 );
486495
496+ $ this ->throttler
497+ ->expects ($ this ->once ())
498+ ->method ('registerAttempt ' )
499+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
500+ $ this ->dispatcher
501+ ->expects ($ this ->once ())
502+ ->method ('dispatchTyped ' )
503+ ->with (new LoginFailed ('john ' , 'doe ' ));
504+
487505 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
488506 }
489507
0 commit comments