$share = $this->newShare();
$this->shareManager->method('newShare')->willReturn($share);
- [$userFolder, $path] = $this->getNonSharedUserFolder();
+ [$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
->method('getUserFolder')
->with('currentUser')
$share = $this->newShare();
$this->shareManager->method('newShare')->willReturn($share);
- [$userFolder, $path] = $this->getNonSharedUserFolder();
+ [$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
->method('getUserFolder')
->with('currentUser')
])->setMethods(['formatShare'])
->getMock();
- [$userFolder, $path] = $this->getNonSharedUserFolder();
+ [$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
->method('getUserFolder')
->with('currentUser')
$this->shareManager->method('createShare')->willReturnArgument(0);
$this->shareManager->method('allowGroupSharing')->willReturn(true);
- [$userFolder, $path] = $this->getNonSharedUserFolder();
+ [$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
->method('getUserFolder')
->with('currentUser')
])->setMethods(['formatShare'])
->getMock();
- [$userFolder, $path] = $this->getNonSharedUserFolder();
+ [$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
->method('getUserFolder')
->with('currentUser')
])->setMethods(['formatShare'])
->getMock();
- [$userFolder, $path] = $this->getNonSharedUserFolder();
+ [$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
->method('getUserFolder')
->with('currentUser')
])->setMethods(['formatShare'])
->getMock();
- [$userFolder, $path] = $this->getNonSharedUserFolder();
+ $userFolder = $this->getMockBuilder(Folder::class)->getMock();
$this->rootFolder->expects($this->exactly(2))
->method('getUserFolder')
->with('currentUser')
->willReturn($userFolder);
+ $path = $this->getMockBuilder(Folder::class)->getMock();
+ $storage = $this->createMock(Storage::class);
+ $storage->method('instanceOfStorage')
+ ->willReturnMap([
+ ['OCA\Files_Sharing\External\Storage', true],
+ ['OCA\Files_Sharing\SharedStorage', false],
+ ]);
+ $userFolder->method('getStorage')->willReturn($storage);
+ $path->method('getStorage')->willReturn($storage);
+
$path->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_READ);
$userFolder->expects($this->once())
->method('get')
->with('valid-path')
->willReturn($path);
$userFolder->method('getById')
- ->willReturn([$path]);
+ ->willReturn([]);
$this->userManager->method('userExists')->with('validUser')->willReturn(true);