$parentFolder = $this->getMockBuilder('OCP\Files\Folder')->getMock();
$parentFolder->method('getId')->willReturn(3);
+ $mountPoint = $this->createMock(IMountPoint::class);
+ $mountPoint->method('getMountType')->willReturn('');
$file = $this->getMockBuilder('OCP\Files\File')->getMock();
$file->method('getId')->willReturn(1);
$file->method('getSize')->willReturn(123465);
$file->method('getMTime')->willReturn(1234567890);
$file->method('getMimeType')->willReturn('myMimeType');
+ $file->method('getMountPoint')->willReturn($mountPoint);
$folder = $this->getMockBuilder('OCP\Files\Folder')->getMock();
$folder->method('getId')->willReturn(2);
$folder->method('getSize')->willReturn(123465);
$folder->method('getMTime')->willReturn(1234567890);
$folder->method('getMimeType')->willReturn('myFolderMimeType');
+ $folder->method('getMountPoint')->willReturn($mountPoint);
[$shareAttributes, $shareAttributesReturnJson] = $this->mockShareAttributes();
'item_size' => 123465,
'item_mtime' => 1234567890,
'attributes' => null,
+ 'item_permissions' => 4,
+ 'is-mount-root' => false,
+ 'mount-type' => '',
];
$data[] = [$share, $expected];
'item_size' => 123465,
'item_mtime' => 1234567890,
'attributes' => null,
+ 'item_permissions' => 4,
+ 'is-mount-root' => false,
+ 'mount-type' => '',
];
$data[] = [$share, $expected];
'item_size' => 123465,
'item_mtime' => 1234567890,
'attributes' => null,
+ 'item_permissions' => 4,
+ 'is-mount-root' => false,
+ 'mount-type' => '',
];
$data[] = [$share, $expected];
$folder->method('getMimeType')->willReturn('myFolderMimeType');
$fileWithPreview->method('getMimeType')->willReturn('mimeWithPreview');
+ $mountPoint = $this->createMock(IMountPoint::class);
+ $mountPoint->method('getMountType')->willReturn('');
+ $file->method('getMountPoint')->willReturn($mountPoint);
+ $folder->method('getMountPoint')->willReturn($mountPoint);
+ $fileWithPreview->method('getMountPoint')->willReturn($mountPoint);
+
$file->method('getPath')->willReturn('file');
$folder->method('getPath')->willReturn('folder');
$fileWithPreview->method('getPath')->willReturn('fileWithPreview');
'item_size' => 123456,
'item_mtime' => 1234567890,
'attributes' => '[{"scope":"permissions","key":"download","enabled":true}]',
+ 'item_permissions' => 1,
+ 'is-mount-root' => false,
+ 'mount-type' => '',
], $share, [], false
];
// User backend up
'item_size' => 123456,
'item_mtime' => 1234567890,
'attributes' => '[{"scope":"permissions","key":"download","enabled":true}]',
+ 'item_permissions' => 1,
+ 'is-mount-root' => false,
+ 'mount-type' => '',
], $share, [
['owner', $owner],
['initiator', $initiator],
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 11,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 11,
], $share, [], false
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 1,
], $share, false, []
];
'is-mount-root' => false,
'mount-type' => '',
'attributes' => null,
+ 'item_permissions' => 9,
], $share, true, [
'share_with_displayname' => 'recipientRoomName'
]
->willReturn(true);
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
- ->setMethods(['formatShare'])
+ ->setMethods(['formatShare', 'canAccessShare'])
->getMock();
$helper->method('formatShare')
->with($share)
->willReturn($formatShareByHelper);
+ $helper->method('canAccessShare')
+ ->with($share)
+ ->willReturn(true);
$this->serverContainer->method('get')
->with('\OCA\Talk\Share\Helper\ShareAPIController')