public function testGetShareInvalidNode() { $share = \OC::$server->getShareManager()->newShare(); $share->setSharedBy('initiator')->setSharedWith('recipient')->setShareOwner('owner'); $this->shareManager->expects($this->once())->method('getShareById')->with('ocinternal:42')->willReturn($share); $expected = new \OC_OCS_Result(null, 404, 'Wrong share ID, share doesn\'t exist'); $this->assertEquals($expected->getMeta(), $this->ocs->getShare(42)->getMeta()); }
public function testGetGetShareNotExists() { $this->shareManager->expects($this->once())->method('getShareById')->with(42)->will($this->throwException(new \OC\Share20\Exception\ShareNotFound())); $expected = new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.'); $this->assertEquals($expected, $this->ocs->getShare(42)); }