public function testGetSharedByWithLimit() { $node = $this->getMock('\\OCP\\Files\\File'); $node->method('getId')->willReturn(42); $node->method('getName')->willReturn('myFile'); $this->tokenHandler->method('generateToken')->willReturn('token'); $this->notifications->method('sendRemoteShare')->willReturn(true); $this->rootFolder->expects($this->never())->method($this->anything()); $share = $this->shareManager->newShare(); $share->setSharedWith('*****@*****.**')->setSharedBy('sharedBy')->setShareOwner('shareOwner')->setPermissions(19)->setNode($node); $this->provider->create($share); $share2 = $this->shareManager->newShare(); $share2->setSharedWith('*****@*****.**')->setSharedBy('sharedBy')->setShareOwner('shareOwner')->setPermissions(19)->setNode($node); $this->provider->create($share2); $shares = $this->provider->getSharesBy('shareOwner', \OCP\Share::SHARE_TYPE_REMOTE, null, true, 1, 1); $this->assertCount(1, $shares); $this->assertEquals('*****@*****.**', $shares[0]->getSharedWith()); }