summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-02 11:27:14 +0100
committerGitHub <noreply@github.com>2018-01-02 11:27:14 +0100
commit37ed5b55234aff0fb0c083755c5876a681312a58 (patch)
treecb72495deae970e821d29c4fb4a153bc311ad9fb /tests
parent9e49b6e2bb2194f61eb8fe1f739e9b0c2184c23f (diff)
parentf5f6ed664d248829c56aac4af3a54909e61216d3 (diff)
downloadnextcloud-server-37ed5b55234aff0fb0c083755c5876a681312a58.tar.gz
nextcloud-server-37ed5b55234aff0fb0c083755c5876a681312a58.zip
Merge pull request #7590 from nextcloud/flow-hide-stay-logged-in
Hide stay logged in checkbox when flow authentication is used
Diffstat (limited to 'tests')
-rw-r--r--tests/Core/Controller/LoginControllerTest.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index e02b8403a2a..ddf7a865d66 100644
--- a/tests/Core/Controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -182,12 +182,43 @@ class LoginControllerTest extends TestCase {
'alt_login' => [],
'rememberLoginState' => 0,
'resetPasswordLink' => null,
+ 'hideRemeberLoginState' => false,
],
'guest'
);
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', '', ''));
}
+ public function testShowLoginFormForFlowAuth() {
+ $this->userSession
+ ->expects($this->once())
+ ->method('isLoggedIn')
+ ->willReturn(false);
+ $this->session
+ ->expects($this->once())
+ ->method('exists')
+ ->with('client.flow.state.token')
+ ->willReturn(true);
+
+ $expectedResponse = new TemplateResponse(
+ 'core',
+ 'login',
+ [
+ 'messages' => [],
+ 'redirect_url' => 'login/flow',
+ 'loginName' => '',
+ 'user_autofocus' => true,
+ 'canResetPassword' => true,
+ 'alt_login' => [],
+ 'rememberLoginState' => 0,
+ 'resetPasswordLink' => null,
+ 'hideRemeberLoginState' => true,
+ ],
+ 'guest'
+ );
+ $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', 'login/flow', ''));
+ }
+
/**
* @return array
*/
@@ -240,6 +271,7 @@ class LoginControllerTest extends TestCase {
'alt_login' => [],
'rememberLoginState' => 0,
'resetPasswordLink' => false,
+ 'hideRemeberLoginState' => false,
],
'guest'
);
@@ -278,6 +310,7 @@ class LoginControllerTest extends TestCase {
'alt_login' => [],
'rememberLoginState' => 0,
'resetPasswordLink' => false,
+ 'hideRemeberLoginState' => false,
],
'guest'
);