From 47bc0248858a0a448f938688b0fea5b506e4dd77 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Wed, 23 Nov 2022 13:37:07 +0100 Subject: Revert the token scope to not end up with storing the user used in the session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/lib/DirectEditing/ManagerTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/lib/DirectEditing/ManagerTest.php b/tests/lib/DirectEditing/ManagerTest.php index e19c44b1a06..7a2f2e3d772 100644 --- a/tests/lib/DirectEditing/ManagerTest.php +++ b/tests/lib/DirectEditing/ManagerTest.php @@ -15,6 +15,7 @@ use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\IDBConnection; use OCP\IL10N; +use OCP\IUser; use OCP\IUserSession; use OCP\L10N\IFactory; use OCP\Security\ISecureRandom; @@ -137,6 +138,14 @@ class ManagerTest extends TestCase { ->method('getUserFolder') ->willReturn($this->userFolder); + $user = $this->createMock(IUser::class); + $user->expects(self::any()) + ->method('getUID') + ->willReturn('admin'); + $this->userSession->expects(self::any()) + ->method('getUser') + ->willReturn($user); + $this->manager = new Manager( $this->random, $this->connection, $this->userSession, $this->rootFolder, $l10nFactory, $this->encryptionManager ); -- cgit v1.2.3