if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
$share->setSharedWith($data['share_with']);
+ $user = $this->userManager->get($data['share_with']);
+ if ($user !== null) {
+ $share->setSharedWithDisplayName($user->getDisplayName());
+ }
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
$share->setSharedWith($data['share_with']);
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
$user0 = $this->createMock(IUser::class);
$user0->method('getUID')->willReturn('user0');
+ $user0->method('getDisplayName')->willReturn('user0');
$user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
+ $user0->method('getDisplayName')->willReturn('user0');
$this->userManager->method('get')->willReturnMap([
['user0', $user0],
$user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
+ $user1->method('getDisplayName')->willReturn('user1');
$user2 = $this->createMock(IUser::class);
$user2->method('getUID')->willReturn('user2');
+ $user2->method('getDisplayName')->willReturn('user2');
$this->userManager->method('get')->will($this->returnValueMap([
['user1', $user1],
['user2', $user2],
$user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
+ $user1->method('getDisplayName')->willReturn('user1');
$user2 = $this->createMock(IUser::class);
$user2->method('getUID')->willReturn('user2');
+ $user2->method('getDisplayName')->willReturn('user2');
$user3 = $this->createMock(IUser::class);
$this->userManager->method('get')->will($this->returnValueMap([
['user1', $user1],
for($i = 0; $i < 6; $i++) {
$user = $this->createMock(IUser::class);
$user->method('getUID')->willReturn('user'.$i);
+ $user->method('getDisplayName')->willReturn('user' . $i);
$users['user'.$i] = $user;
}
$user0 = $this->createMock(IUser::class);
$user0->method('getUID')->willReturn('user0');
+ $user0->method('getDisplayName')->willReturn('user0');
$user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
+ $user1->method('getDisplayName')->willReturn('user1');
$this->userManager->method('get')->will($this->returnValueMap([
['user0', $user0],