@@ -498,7 +498,7 @@ public function testLoginWithValidCredentials() {
498498 $ this ->assertEquals ($ expected , $ this ->loginController ->tryLogin ($ user , $ password ));
499499 }
500500
501- public function testLoginWithoutPassedCsrfCheckAndNotLoggedIn () {
501+ public function testLoginWithoutPassedCsrfCheckAndNotLoggedIn (): void {
502502 /** @var IUser|MockObject $user */
503503 $ user = $ this ->createMock (IUser::class);
504504 $ user ->expects ($ this ->any ())
@@ -511,21 +511,20 @@ public function testLoginWithoutPassedCsrfCheckAndNotLoggedIn() {
511511 ->expects ($ this ->once ())
512512 ->method ('passesCSRFCheck ' )
513513 ->willReturn (false );
514- $ this ->userSession -> expects ( $ this -> once ())
514+ $ this ->userSession
515515 ->method ('isLoggedIn ' )
516516 ->with ()
517517 ->willReturn (false );
518518 $ this ->config ->expects ($ this ->never ())
519519 ->method ('deleteUserValue ' );
520520 $ this ->userSession ->expects ($ this ->never ())
521521 ->method ('createRememberMeToken ' );
522- $ this ->urlGenerator
523- ->expects ($ this ->once ())
524- ->method ('linkToDefaultPageUrl ' )
525- ->willReturn ('/default/foo ' );
526522
527- $ expected = new RedirectResponse ('/default/foo ' );
528- $ this ->assertEquals ($ expected , $ this ->loginController ->tryLogin ('Jane ' , $ password , $ originalUrl ));
523+ $ response = $ this ->loginController ->tryLogin ('Jane ' , $ password , $ originalUrl );
524+
525+ $ expected = new RedirectResponse ('' );
526+ $ expected ->throttle (['user ' => 'Jane ' ]);
527+ $ this ->assertEquals ($ expected , $ response );
529528 }
530529
531530 public function testLoginWithoutPassedCsrfCheckAndLoggedIn () {
@@ -542,7 +541,7 @@ public function testLoginWithoutPassedCsrfCheckAndLoggedIn() {
542541 ->expects ($ this ->once ())
543542 ->method ('passesCSRFCheck ' )
544543 ->willReturn (false );
545- $ this ->userSession -> expects ( $ this -> once ())
544+ $ this ->userSession
546545 ->method ('isLoggedIn ' )
547546 ->with ()
548547 ->willReturn (true );
@@ -559,8 +558,10 @@ public function testLoginWithoutPassedCsrfCheckAndLoggedIn() {
559558 ->with ('remember_login_cookie_lifetime ' )
560559 ->willReturn (1234 );
561560
561+ $ response = $ this ->loginController ->tryLogin ('Jane ' , $ password , $ originalUrl );
562+
562563 $ expected = new RedirectResponse ($ redirectUrl );
563- $ this ->assertEquals ($ expected , $ this -> loginController -> tryLogin ( ' Jane ' , $ password , $ originalUrl ) );
564+ $ this ->assertEquals ($ expected , $ response );
564565 }
565566
566567 public function testLoginWithValidCredentialsAndRedirectUrl () {
0 commit comments