@@ -449,7 +449,7 @@ public function testLogClientInNoTokenPasswordWith2fa() {
449449 ->method ('getRemoteAddress ' )
450450 ->willReturn ('192.168.0.1 ' );
451451 $ this ->throttler
452- ->expects ($ this ->once ( ))
452+ ->expects ($ this ->exactly ( 2 ))
453453 ->method ('sleepDelayOrThrowOnMax ' )
454454 ->with ('192.168.0.1 ' );
455455 $ this ->throttler
@@ -458,6 +458,15 @@ public function testLogClientInNoTokenPasswordWith2fa() {
458458 ->with ('192.168.0.1 ' )
459459 ->willReturn (0 );
460460
461+ $ this ->throttler
462+ ->expects ($ this ->once ())
463+ ->method ('registerAttempt ' )
464+ ->with ('login ' , '192.168.0.1 ' , ['user ' => 'john ' ]);
465+ $ this ->dispatcher
466+ ->expects ($ this ->once ())
467+ ->method ('dispatchTyped ' )
468+ ->with (new LoginFailed ('john ' , 'doe ' ));
469+
461470 $ userSession ->logClientIn ('john ' , 'doe ' , $ request , $ this ->throttler );
462471 }
463472
@@ -561,7 +570,7 @@ public function testLogClientInNoTokenPasswordNo2fa() {
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() {
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