public function createShare($id, $shareType, $sharedWith, $sharedBy, $shareOwner, $path, $permissions,
$shareTime, $expiration, $parent, $target, $mail_send, $note = '', $token=null,
- $password=null) {
+ $password=null, $label = '') {
$share = $this->getMockBuilder(IShare::class)->getMock();
$share->method('getId')->willReturn($id);
$share->method('getShareType')->willReturn($shareType);
$share->method('getNode')->willReturn($path);
$share->method('getPermissions')->willReturn($permissions);
$share->method('getNote')->willReturn($note);
+ $share->method('getLabel')->willReturn($label);
$time = new \DateTime();
$time->setTimestamp($shareTime);
$share->method('getShareTime')->willReturn($time);
'mail_send' => 0,
'uid_file_owner' => 'ownerId',
'note' => 'personal note',
+ 'label' => '',
'displayname_file_owner' => 'ownerDisplay',
'mimetype' => 'myMimeType',
'hide_download' => 0,
'mail_send' => 0,
'uid_file_owner' => 'ownerId',
'note' => 'personal note',
+ 'label' => '',
'displayname_file_owner' => 'ownerDisplay',
'mimetype' => 'myFolderMimeType',
'hide_download' => 0,
0,
'personal note',
'token',
- 'password'
+ 'password',
+ 'first link share'
);
$expected = [
'id' => 101,
'url' => 'url',
'uid_file_owner' => 'ownerId',
'note' => 'personal note',
+ 'label' => 'first link share',
'displayname_file_owner' => 'ownerDisplay',
'mimetype' => 'myFolderMimeType',
'hide_download' => 0,
'share_with' => 'recipient',
'share_with_displayname' => 'recipient',
'note' => 'personal note',
+ 'label' => null,
'mail_send' => 0,
'mimetype' => 'myMimeType',
'hide_download' => 0,
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'ownerDN',
'note' => 'personal note',
+ 'label' => null,
'path' => 'file',
'item_type' => 'file',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => 'personal note',
+ 'label' => null,
'path' => 'file',
'item_type' => 'file',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => 'personal note',
+ 'label' => null,
'path' => 'file',
'item_type' => 'file',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => 'personal note',
+ 'label' => null,
'path' => 'file',
'item_type' => 'file',
'storage_id' => 'storageId',
->setExpirationDate(new \DateTime('2001-01-02T00:00:00'))
->setToken('myToken')
->setNote('personal note')
+ ->setLabel('new link share')
->setId(42);
$result[] = [
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => 'personal note',
+ 'label' => 'new link share',
'path' => 'file',
'item_type' => 'file',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => 'personal note',
+ 'label' => null,
'path' => 'folder',
'item_type' => 'folder',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => '',
+ 'label' => null,
'path' => 'folder',
'item_type' => 'folder',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => '',
+ 'label' => null,
'path' => 'folder',
'item_type' => 'folder',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => '',
+ 'label' => null,
'path' => 'folder',
'item_type' => 'folder',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => '',
+ 'label' => null,
'path' => 'folder',
'item_type' => 'folder',
'storage_id' => 'storageId',
'uid_file_owner' => 'owner',
'displayname_file_owner' => 'owner',
'note' => '',
+ 'label' => null,
'path' => 'folder',
'item_type' => 'folder',
'storage_id' => 'storageId',
'mail_send' => 0,
'mimetype' => 'myMimeType',
'hide_download' => 0,
+ 'label' => '',
], $share, false, []
];
'mail_send' => 0,
'mimetype' => 'myMimeType',
'hide_download' => 0,
+ 'label' => '',
], $share, true, [
'share_with_displayname' => 'recipientRoomName'
]