summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-01-23 10:12:01 +0100
committerGitHub <noreply@github.com>2019-01-23 10:12:01 +0100
commitf2b118a2561952663a9040e2909ff9d20ea60ffc (patch)
treecdeaf145eeb70bb9d3d81e92bbafeccfed26216b /tests
parent308d5d54def17c4b34b96c97d51d714b1da5f48d (diff)
parente6333c8fe389aca4e1e8349f276de0058c20c6bb (diff)
downloadnextcloud-server-f2b118a2561952663a9040e2909ff9d20ea60ffc.tar.gz
nextcloud-server-f2b118a2561952663a9040e2909ff9d20ea60ffc.zip
Merge pull request #13747 from nextcloud/fix/honor_session_lifetime_if_remember_cookie_is_disabled
Honor remember_login_cookie_lifetime
Diffstat (limited to 'tests')
-rw-r--r--tests/Core/Controller/LoginControllerTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index efe85d81e1c..bb21903b653 100644
--- a/tests/Core/Controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -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');