From 138deec333b0dbfbc44968f2192e1bf2c27e4ee8 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 15 Dec 2022 10:52:28 +0100 Subject: [PATCH] chore: Make the LoginController strict Signed-off-by: Christoph Wurst --- core/Controller/LoginController.php | 5 ++++- tests/Core/Controller/LoginControllerTest.php | 21 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 4ec6d5c38c4..4c4a12355d2 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -1,4 +1,7 @@ * @copyright Copyright (c) 2016 Joas Schilling @@ -227,7 +230,7 @@ class LoginController extends Controller { $user = null; } - $passwordLink = $this->config->getSystemValue('lost_password_link', ''); + $passwordLink = $this->config->getSystemValueString('lost_password_link', ''); $this->initialStateService->provideInitialState( 'core', diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index b80fde008d5..fae20ae6b74 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -1,4 +1,7 @@ * @@ -337,11 +340,16 @@ class LoginControllerTest extends TestCase { ->method('isLoggedIn') ->willReturn(false); $this->config - ->expects($this->exactly(2)) + ->expects(self::once()) ->method('getSystemValue') ->willReturnMap([ ['login_form_autocomplete', true, true], - ['lost_password_link', '', false], + ]); + $this->config + ->expects(self::once()) + ->method('getSystemValueString') + ->willReturnMap([ + ['lost_password_link', '', ''], ]); $user = $this->createMock(IUser::class); $user @@ -386,11 +394,16 @@ class LoginControllerTest extends TestCase { ->method('isLoggedIn') ->willReturn(false); $this->config - ->expects($this->exactly(2)) + ->expects(self::once()) ->method('getSystemValue') ->willReturnMap([ ['login_form_autocomplete', true, true], - ['lost_password_link', '', false], + ]); + $this->config + ->expects(self::once()) + ->method('getSystemValueString') + ->willReturnMap([ + ['lost_password_link', '', ''], ]); $user = $this->createMock(IUser::class); $user->expects($this->once()) -- 2.39.5