Skip to content

Commit

Permalink
fixup! fix: Proper error message based on file permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
juliushaertl committed Jan 17, 2024
1 parent ee770ec commit 22d657f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/unit/Service/DocumentServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 22d657f

Please sign in to comment.