Beispiel #1
0
 public function testMoveShareGroup()
 {
     $share = $this->manager->newShare();
     $share->setShareType(\OCP\Share::SHARE_TYPE_GROUP);
     $sharedWith = $this->getMock('\\OCP\\IGroup');
     $share->setSharedWith($sharedWith);
     $recipient = $this->getMock('\\OCP\\IUser');
     $sharedWith->method('inGroup')->with($recipient)->willReturn(true);
     $this->defaultProvider->method('move')->with($share, $recipient)->will($this->returnArgument(0));
     $this->manager->moveShare($share, $recipient);
 }
Beispiel #2
0
 public function testMoveShareGroup()
 {
     $share = $this->manager->newShare();
     $share->setShareType(\OCP\Share::SHARE_TYPE_GROUP)->setId('42')->setProviderId('foo');
     $group = $this->getMock('\\OCP\\IGroup');
     $share->setSharedWith('group');
     $recipient = $this->getMock('\\OCP\\IUser');
     $group->method('inGroup')->with($recipient)->willReturn(true);
     $this->groupManager->method('get')->with('group')->willReturn($group);
     $this->userManager->method('get')->with('recipient')->willReturn($recipient);
     $this->defaultProvider->method('move')->with($share, 'recipient')->will($this->returnArgument(0));
     $this->manager->moveShare($share, 'recipient');
 }