|
|
@@ -449,6 +449,10 @@ class LoginControllerTest extends TestCase { |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('setUserValue') |
|
|
|
->with('uid', 'core', 'timezone', 'Europe/Berlin'); |
|
|
|
$this->config |
|
|
|
->method('getSystemValue') |
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
->willReturn(1234); |
|
|
|
$this->userSession->expects($this->never()) |
|
|
|
->method('createRememberMeToken'); |
|
|
|
|
|
|
@@ -493,6 +497,10 @@ class LoginControllerTest extends TestCase { |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('deleteUserValue') |
|
|
|
->with('uid', 'core', 'lostpassword'); |
|
|
|
$this->config |
|
|
|
->method('getSystemValue') |
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
->willReturn(1234); |
|
|
|
$this->userSession->expects($this->once()) |
|
|
|
->method('createRememberMeToken') |
|
|
|
->with($user); |
|
|
@@ -553,6 +561,10 @@ class LoginControllerTest extends TestCase { |
|
|
|
->method('deleteUserValue'); |
|
|
|
$this->userSession->expects($this->never()) |
|
|
|
->method('createRememberMeToken'); |
|
|
|
$this->config |
|
|
|
->method('getSystemValue') |
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
->willReturn(1234); |
|
|
|
|
|
|
|
$expected = new \OCP\AppFramework\Http\RedirectResponse($redirectUrl); |
|
|
|
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl)); |
|
|
@@ -590,6 +602,10 @@ class LoginControllerTest extends TestCase { |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('deleteUserValue') |
|
|
|
->with('jane', 'core', 'lostpassword'); |
|
|
|
$this->config |
|
|
|
->method('getSystemValue') |
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
->willReturn(1234); |
|
|
|
|
|
|
|
$expected = new \OCP\AppFramework\Http\RedirectResponse(urldecode($redirectUrl)); |
|
|
|
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl)); |
|
|
@@ -642,6 +658,10 @@ class LoginControllerTest extends TestCase { |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('deleteUserValue') |
|
|
|
->with('john', 'core', 'lostpassword'); |
|
|
|
$this->config |
|
|
|
->method('getSystemValue') |
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
->willReturn(1234); |
|
|
|
$this->userSession->expects($this->never()) |
|
|
|
->method('createRememberMeToken'); |
|
|
|
|
|
|
@@ -694,6 +714,10 @@ class LoginControllerTest extends TestCase { |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('deleteUserValue') |
|
|
|
->with('john', 'core', 'lostpassword'); |
|
|
|
$this->config |
|
|
|
->method('getSystemValue') |
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
->willReturn(1234); |
|
|
|
$this->userSession->expects($this->never()) |
|
|
|
->method('createRememberMeToken'); |
|
|
|
|