From 22d657f0a17212fa0e6137897b7e7bd2f617beef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 17 Jan 2024 10:50:03 +0100 Subject: [PATCH] fixup! fix: Proper error message based on file permissions --- tests/unit/Service/DocumentServiceTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/Service/DocumentServiceTest.php b/tests/unit/Service/DocumentServiceTest.php index d9fa3a2d20e..d47e71f1855 100644 --- a/tests/unit/Service/DocumentServiceTest.php +++ b/tests/unit/Service/DocumentServiceTest.php @@ -12,12 +12,12 @@ use OCP\Files\IAppData; use OCP\Files\IRootFolder; use OCP\Files\Lock\ILockManager; -use OCP\Files\NotPermittedException; +use OCP\Files\NotFoundException; use OCP\ICacheFactory; +use OCP\ILogger; use OCP\IRequest; use OCP\Lock\ILockingProvider; use OCP\Share\IManager; -use Psr\Log\LoggerInterface; class DocumentServiceTest extends \PHPUnit\Framework\TestCase { private $documentService; @@ -45,7 +45,7 @@ public function setUp(): void { $this->userId = 'admin'; $this->rootFolder = $this->createMock(IRootFolder::class); $this->cacheFactory = $this->createMock(ICacheFactory::class); - $this->loggerInterface = $this->createMock(LoggerInterface::class); + $this->loggerInterface = $this->createMock(ILogger::class); $this->shareManager = $this->createMock(IManager::class); $this->request = $this->createMock(IRequest::class); $this->directManager = $this->createMock(\OCP\DirectEditing\IManager::class); @@ -102,7 +102,7 @@ public function testGetFileByIdNoRead() { $file = $this->createMock(\OCP\Files\File::class); $file->method('getPermissions')->willReturn(Constants::PERMISSION_UPDATE); $userFolder->method('getById')->willReturn([$file]); - $this->expectException(NotPermittedException::class); + $this->expectException(NotFoundException::class); $actual = $this->documentService->getFileById(1234); } }