From b26caaa6e5828cdf50302947467ff770a23200e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 30 Dec 2020 14:33:38 +0100 Subject: [PATCH] Fix integration tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/ConfigService.php | 6 ++++-- lib/Sharing/Listener.php | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 2d657c038..b36f0e607 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -32,6 +32,7 @@ use OCA\Deck\NoPermissionException; use OCP\IConfig; use OCP\IGroup; use OCP\IGroupManager; +use OCP\IUserSession; class ConfigService { public const SETTING_BOARD_NOTIFICATION_DUE_OFF = 'off'; @@ -46,9 +47,10 @@ class ConfigService { public function __construct( IConfig $config, IGroupManager $groupManager, - $userId + IUserSession $userSession ) { - $this->userId = $userId; + // Session is required here in order to make the tests properly inject the userId later on + $this->userId = $userSession->getUser() ? $userSession->getUser()->getUID() : null; $this->groupManager = $groupManager; $this->config = $config; } diff --git a/lib/Sharing/Listener.php b/lib/Sharing/Listener.php index 580b2e5c6..8fa954fcd 100644 --- a/lib/Sharing/Listener.php +++ b/lib/Sharing/Listener.php @@ -37,12 +37,9 @@ class Listener { /** @var ConfigService */ private $configService; - /** @var string|null */ - private $userId; - public function __construct(ConfigService $configService, $userId) { + public function __construct(ConfigService $configService) { $this->configService = $configService; - $this->userId = $userId; } public function register(IEventDispatcher $dispatcher): void {