public function testUserCreateChecksIdenticalPathSharedViaDeletedGroup() {
$share = $this->manager->newShare();
- $sharedWith = $this->getMock('\OCP\IUser');
+ $sharedWith = $this->createMock(IUser::class);
$sharedWith->method('getUID')->willReturn('sharedWith');
$this->userManager->method('get')->with('sharedWith')->willReturn($sharedWith);
- $path = $this->getMock('\OCP\Files\Node');
+ $path = $this->createMock(Node::class);
$share->setSharedWith('sharedWith')
->setNode($path)
public function testGroupCreateChecksShareWithGroupMembersOnlyNullGroup() {
$share = $this->manager->newShare();
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$share->setSharedBy('user')->setSharedWith('group');
$this->groupManager->method('get')->with('group')->willReturn(null);
$share->setShareType(\OCP\Share::SHARE_TYPE_GROUP);
$share->setSharedWith('shareWith');
- $recipient = $this->getMock('\OCP\IUser');
+ $recipient = $this->createMock(IUser::class);
$this->groupManager->method('get')->with('shareWith')->willReturn(null);
$this->userManager->method('get')->with('recipient')->willReturn($recipient);
->willReturn($folder);
$file->method('getPath')
->willReturn('/owner/files/folder/file');
+ $file->method('getId')
+ ->willReturn(23);
$folder->method('getParent')
->willReturn($userFolder);
$folder->method('getPath')
)
->willReturn([
'users' => [
- 'user1',
- 'user2',
- 'user3',
+ 'user1' => [],
+ 'user2' => [],
+ 'user3' => [],
],
'public' => true,
]);
)
->willReturn([
'users' => [
- 'user3',
- 'user4',
- 'user5',
+ 'user3' => [],
+ 'user4' => [],
+ 'user5' => [],
+ ],
+ 'remote' => [
+ 'remote1',
],
- 'remote' => true,
]);
$this->rootFolder->method('getUserFolder')
->willReturn($userFolder);
$expected = [
- 'users' => ['owner', 'user1', 'user2', 'user3', 'user4', 'user5'],
+ 'users' => [
+ 'owner' => [
+ 'node_id' => 23,
+ 'node_path' => '/folder/file'
+ ]
+ , 'user1' => [], 'user2' => [], 'user3' => [], 'user4' => [], 'user5' => []],
+ 'remote' => [
+ 'remote1',
+ ],
'public' => true,
- 'remote' => true,
];
$result = $manager->getAccessList($node, true, true);