From f5f6ed664d248829c56aac4af3a54909e61216d3 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 21 Dec 2017 00:25:30 +0100 Subject: Hide stay logged in checkbox when flow authentication is used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/Core/Controller/LoginControllerTest.php | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'tests') 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' ); -- cgit v1.2.3