]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge pull request #2424 from nextcloud/fix-login-controller-test-consolidate-login
authorMorris Jobke <hey@morrisjobke.de>
Thu, 13 Apr 2017 17:16:38 +0000 (12:16 -0500)
committerGitHub <noreply@github.com>
Thu, 13 Apr 2017 17:16:38 +0000 (12:16 -0500)
Fix login controller test and consolidate login

1  2 
core/Controller/LoginController.php
tests/Core/Controller/LoginControllerTest.php

Simple merge
index c8e85a199462c441f5d751b10b838aa7ae916ce5,aa6ebe493859be307efaa4d24358fc3d7d840669..9387e69c405b5a075fad545b0c54758a16494f51
@@@ -357,14 -359,14 +358,14 @@@ class LoginControllerTest extends TestC
                        ->with('192.168.0.1')
                        ->willReturn(200);
                $this->userManager->expects($this->once())
 -                      ->method('checkPassword')
 +                      ->method('checkPasswordNoLogging')
                        ->will($this->returnValue($user));
                $this->userSession->expects($this->once())
-                       ->method('login')
-                       ->with($user, $password);
+                       ->method('completeLogin')
+                       ->with($user, ['loginName' => $loginName, 'password' => $password]);
                $this->userSession->expects($this->once())
                        ->method('createSessionToken')
-                       ->with($this->request, $user->getUID(), $user, $password, false);
+                       ->with($this->request, $user->getUID(), $loginName, $password, false);
                $this->twoFactorManager->expects($this->once())
                        ->method('isTwoFactorAuthenticated')
                        ->with($user)
                        ->with('192.168.0.1')
                        ->willReturn(200);
                $this->userManager->expects($this->once())
 -                      ->method('checkPassword')
 +                      ->method('checkPasswordNoLogging')
                        ->will($this->returnValue($user));
                $this->userSession->expects($this->once())
-                       ->method('login')
-                       ->with($user, $password);
+                       ->method('completeLogin')
+                       ->with($user, ['loginName' => $loginName, 'password' => $password]);
                $this->userSession->expects($this->once())
                        ->method('createSessionToken')
-                       ->with($this->request, $user->getUID(), $user, $password, true);
+                       ->with($this->request, $user->getUID(), $loginName, $password, true);
                $this->twoFactorManager->expects($this->once())
                        ->method('isTwoFactorAuthenticated')
                        ->with($user)
                        ->with('192.168.0.1')
                        ->willReturn(200);
                $this->userManager->expects($this->once())
 -                      ->method('checkPassword')
 +                      ->method('checkPasswordNoLogging')
                        ->will($this->returnValue($user));
                $this->userSession->expects($this->once())
-                       ->method('login')
-                       ->with('john@doe.com', $password);
+                       ->method('completeLogin')
+                       ->with($user, ['loginName' => 'john@doe.com', 'password' => $password]);
                $this->userSession->expects($this->once())
                        ->method('createSessionToken')
                        ->with($this->request, $user->getUID(), 'john@doe.com', $password, false);
                        ->with('192.168.0.1')
                        ->willReturn(200);
                $this->userManager->expects($this->once())
 -                      ->method('checkPassword')
 +                      ->method('checkPasswordNoLogging')
                        ->will($this->returnValue($user));
                $this->userSession->expects($this->once())
-                       ->method('login')
-                       ->with('john@doe.com', $password);
+                       ->method('completeLogin')
+                       ->with($user, ['loginName' => 'john@doe.com', 'password' => $password]);
                $this->userSession->expects($this->once())
                        ->method('createSessionToken')
                        ->with($this->request, $user->getUID(), 'john@doe.com', $password, false);