|
|
|
|
|
|
|
|
$this->config->expects($this->once()) |
|
|
$this->config->expects($this->once()) |
|
|
->method('setUserValue') |
|
|
->method('setUserValue') |
|
|
->with('uid', 'core', 'timezone', 'Europe/Berlin'); |
|
|
->with('uid', 'core', 'timezone', 'Europe/Berlin'); |
|
|
|
|
|
$this->config |
|
|
|
|
|
->method('getSystemValue') |
|
|
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
|
|
->willReturn(1234); |
|
|
$this->userSession->expects($this->never()) |
|
|
$this->userSession->expects($this->never()) |
|
|
->method('createRememberMeToken'); |
|
|
->method('createRememberMeToken'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->config->expects($this->once()) |
|
|
$this->config->expects($this->once()) |
|
|
->method('deleteUserValue') |
|
|
->method('deleteUserValue') |
|
|
->with('uid', 'core', 'lostpassword'); |
|
|
->with('uid', 'core', 'lostpassword'); |
|
|
|
|
|
$this->config |
|
|
|
|
|
->method('getSystemValue') |
|
|
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
|
|
->willReturn(1234); |
|
|
$this->userSession->expects($this->once()) |
|
|
$this->userSession->expects($this->once()) |
|
|
->method('createRememberMeToken') |
|
|
->method('createRememberMeToken') |
|
|
->with($user); |
|
|
->with($user); |
|
|
|
|
|
|
|
|
->method('deleteUserValue'); |
|
|
->method('deleteUserValue'); |
|
|
$this->userSession->expects($this->never()) |
|
|
$this->userSession->expects($this->never()) |
|
|
->method('createRememberMeToken'); |
|
|
->method('createRememberMeToken'); |
|
|
|
|
|
$this->config |
|
|
|
|
|
->method('getSystemValue') |
|
|
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
|
|
->willReturn(1234); |
|
|
|
|
|
|
|
|
$expected = new \OCP\AppFramework\Http\RedirectResponse($redirectUrl); |
|
|
$expected = new \OCP\AppFramework\Http\RedirectResponse($redirectUrl); |
|
|
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl)); |
|
|
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl)); |
|
|
|
|
|
|
|
|
$this->config->expects($this->once()) |
|
|
$this->config->expects($this->once()) |
|
|
->method('deleteUserValue') |
|
|
->method('deleteUserValue') |
|
|
->with('jane', 'core', 'lostpassword'); |
|
|
->with('jane', 'core', 'lostpassword'); |
|
|
|
|
|
$this->config |
|
|
|
|
|
->method('getSystemValue') |
|
|
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
|
|
->willReturn(1234); |
|
|
|
|
|
|
|
|
$expected = new \OCP\AppFramework\Http\RedirectResponse(urldecode($redirectUrl)); |
|
|
$expected = new \OCP\AppFramework\Http\RedirectResponse(urldecode($redirectUrl)); |
|
|
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl)); |
|
|
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl)); |
|
|
|
|
|
|
|
|
$this->config->expects($this->once()) |
|
|
$this->config->expects($this->once()) |
|
|
->method('deleteUserValue') |
|
|
->method('deleteUserValue') |
|
|
->with('john', 'core', 'lostpassword'); |
|
|
->with('john', 'core', 'lostpassword'); |
|
|
|
|
|
$this->config |
|
|
|
|
|
->method('getSystemValue') |
|
|
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
|
|
->willReturn(1234); |
|
|
$this->userSession->expects($this->never()) |
|
|
$this->userSession->expects($this->never()) |
|
|
->method('createRememberMeToken'); |
|
|
->method('createRememberMeToken'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->config->expects($this->once()) |
|
|
$this->config->expects($this->once()) |
|
|
->method('deleteUserValue') |
|
|
->method('deleteUserValue') |
|
|
->with('john', 'core', 'lostpassword'); |
|
|
->with('john', 'core', 'lostpassword'); |
|
|
|
|
|
$this->config |
|
|
|
|
|
->method('getSystemValue') |
|
|
|
|
|
->with('remember_login_cookie_lifetime') |
|
|
|
|
|
->willReturn(1234); |
|
|
$this->userSession->expects($this->never()) |
|
|
$this->userSession->expects($this->never()) |
|
|
->method('createRememberMeToken'); |
|
|
->method('createRememberMeToken'); |
|
|
|
|
|
|