diff options
Diffstat (limited to 'apps/files_sharing/tests/api')
-rw-r--r-- | apps/files_sharing/tests/api/share20ocstest.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/apps/files_sharing/tests/api/share20ocstest.php b/apps/files_sharing/tests/api/share20ocstest.php index b594d253eb2..81166b9e3c4 100644 --- a/apps/files_sharing/tests/api/share20ocstest.php +++ b/apps/files_sharing/tests/api/share20ocstest.php @@ -82,7 +82,7 @@ class Share20OCSTest extends \Test\TestCase { $this->shareManager ->expects($this->once()) ->method('getShareById') - ->with(42) + ->with('ocinternal:42') ->will($this->throwException(new \OC\Share20\Exception\ShareNotFound())); $expected = new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.'); @@ -95,7 +95,7 @@ class Share20OCSTest extends \Test\TestCase { $this->shareManager ->expects($this->once()) ->method('getShareById') - ->with(42) + ->with('ocinternal:42') ->willReturn($share); $this->shareManager ->expects($this->once()) @@ -114,7 +114,7 @@ class Share20OCSTest extends \Test\TestCase { $this->shareManager ->expects($this->once()) ->method('getShareById') - ->with(42) + ->with('ocinternal:42') ->willReturn($share); $this->shareManager ->expects($this->once()) @@ -125,16 +125,20 @@ class Share20OCSTest extends \Test\TestCase { $this->assertEquals($expected, $this->ocs->deleteShare(42)); } + /* + * FIXME: Enable once we have a federated Share Provider + public function testGetGetShareNotExists() { $this->shareManager ->expects($this->once()) ->method('getShareById') - ->with(42) + ->with('ocinternal: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)); } + */ public function createShare($id, $shareType, $sharedWith, $sharedBy, $shareOwner, $path, $permissions, $shareTime, $expiration, $parent, $target, $mail_send, $token=null, @@ -155,6 +159,12 @@ class Share20OCSTest extends \Test\TestCase { $share->method('getToken')->willReturn($token); $share->method('getPassword')->willReturn($password); + if ($shareType === \OCP\Share::SHARE_TYPE_USER || + $shareType === \OCP\Share::SHARE_TYPE_GROUP || + $shareType === \OCP\Share::SHARE_TYPE_LINK) { + $share->method('getFullId')->willReturn('ocinternal:'.$id); + } + return $share; } @@ -345,7 +355,7 @@ class Share20OCSTest extends \Test\TestCase { $this->shareManager ->expects($this->once()) ->method('getShareById') - ->with($share->getId()) + ->with($share->getFullId()) ->willReturn($share); $userFolder = $this->getMock('OCP\Files\Folder'); |