diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-12-21 00:25:30 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-12-28 11:15:26 +0100 |
commit | f5f6ed664d248829c56aac4af3a54909e61216d3 (patch) | |
tree | 0f6544a49129698982c94cedd9e87de05e24cd77 /tests | |
parent | 08cbfb6c6b554eed221aafe185c02dc2e7841d95 (diff) | |
download | nextcloud-server-f5f6ed664d248829c56aac4af3a54909e61216d3.tar.gz nextcloud-server-f5f6ed664d248829c56aac4af3a54909e61216d3.zip |
Hide stay logged in checkbox when flow authentication is used
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/LoginControllerTest.php | 33 |
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' ); |