@@ -451,7 +451,7 @@ public function testLogClientInNoTokenPasswordWith2fa(): void {
451451 ->method ('getRemoteAddress ' )
452452 ->willReturn ('192.168.0.1 ' );
453453 $ this ->throttler
454- ->expects ($ this ->once ( ))
454+ ->expects ($ this ->exactly ( 2 ))
455455 ->method ('sleepDelayOrThrowOnMax ' )
456456 ->with ('192.168.0.1 ' );
457457 $ this ->throttler
@@ -460,6 +460,15 @@ public function testLogClientInNoTokenPasswordWith2fa(): void {
460460 ->with ('192.168.0.1 ' )
461461 ->willReturn (0 );
462462
463+ $ this ->throttler
464+ ->expects ($ this ->once ())
465+ ->method ('registerAttempt ' )
466+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
467+ $ this ->dispatcher
468+ ->expects ($ this ->once ())
469+ ->method ('dispatchTyped ' )
470+ ->with (new LoginFailed ('john ' , 'doe ' ));
471+
463472 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
464473 }
465474
@@ -561,7 +570,7 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
561570 ->method ('getRemoteAddress ' )
562571 ->willReturn ('192.168.0.1 ' );
563572 $ this ->throttler
564- ->expects ($ this ->once ( ))
573+ ->expects ($ this ->exactly ( 2 ))
565574 ->method ('sleepDelayOrThrowOnMax ' )
566575 ->with ('192.168.0.1 ' );
567576 $ this ->throttler
@@ -570,6 +579,15 @@ public function testLogClientInNoTokenPasswordNo2fa(): void {
570579 ->with ('192.168.0.1 ' )
571580 ->willReturn (0 );
572581
582+ $ this ->throttler
583+ ->expects ($ this ->once ())
584+ ->method ('registerAttempt ' )
585+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
586+ $ this ->dispatcher
587+ ->expects ($ this ->once ())
588+ ->method ('dispatchTyped ' )
589+ ->with (new LoginFailed ('john ' , 'doe ' ));
590+
573591 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
574592 }
575593
0 commit comments