public function dataGetShare() {
$data = [];
+ $initiator = $this->getMock('OCP\IUser');
+ $initiator->method('getUID')->willReturn('initiatorId');
+ $initiator->method('getDisplayName')->willReturn('initiatorDisplay');
+
$owner = $this->getMock('OCP\IUser');
$owner->method('getUID')->willReturn('ownerId');
$owner->method('getDisplayName')->willReturn('ownerDisplay');
$storage->method('getId')->willReturn('STORAGE');
$storage->method('getCache')->willReturn($cache);
-
-
$parentFolder = $this->getMock('OCP\Files\Folder');
$parentFolder->method('getId')->willReturn(3);
100,
\OCP\Share::SHARE_TYPE_USER,
$user,
- $owner,
+ $initiator,
$owner,
$file,
4,
'share_type' => \OCP\Share::SHARE_TYPE_USER,
'share_with' => 'userId',
'share_with_displayname' => 'userDisplay',
- 'uid_owner' => 'ownerId',
- 'displayname_owner' => 'ownerDisplay',
+ 'uid_owner' => 'initiatorId',
+ 'displayname_owner' => 'initiatorDisplay',
'item_type' => 'file',
'item_source' => 1,
'file_source' => 1,
'path' => 'file',
'storage' => 101,
'mail_send' => 0,
+ 'uid_file_owner' => 'ownerId',
+ 'displayname_file_owner' => 'ownerDisplay'
];
$data[] = [$share, $expected];
101,
\OCP\Share::SHARE_TYPE_GROUP,
$group,
- $owner,
+ $initiator,
$owner,
$folder,
4,
'share_type' => \OCP\Share::SHARE_TYPE_GROUP,
'share_with' => 'groupId',
'share_with_displayname' => 'groupId',
- 'uid_owner' => 'ownerId',
- 'displayname_owner' => 'ownerDisplay',
+ 'uid_owner' => 'initiatorId',
+ 'displayname_owner' => 'initiatorDisplay',
'item_type' => 'folder',
'item_source' => 2,
'file_source' => 2,
'path' => 'folder',
'storage' => 101,
'mail_send' => 0,
+ 'uid_file_owner' => 'ownerId',
+ 'displayname_file_owner' => 'ownerDisplay'
];
$data[] = [$share, $expected];
101,
\OCP\Share::SHARE_TYPE_LINK,
null,
- $owner,
+ $initiator,
$owner,
$folder,
4,
'share_type' => \OCP\Share::SHARE_TYPE_LINK,
'share_with' => 'password',
'share_with_displayname' => 'password',
- 'uid_owner' => 'ownerId',
- 'displayname_owner' => 'ownerDisplay',
+ 'uid_owner' => 'initiatorId',
+ 'displayname_owner' => 'initiatorDisplay',
'item_type' => 'folder',
'item_source' => 2,
'file_source' => 2,
'storage' => 101,
'mail_send' => 0,
'url' => 'url',
+ 'uid_file_owner' => 'ownerId',
+ 'displayname_file_owner' => 'ownerDisplay'
];
$data[] = [$share, $expected];