summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-04 10:01:40 +0100
committerBjörn Schießle <bjoern@schiessle.org>2016-02-08 11:30:48 +0100
commitbec1de8a385991f8ecc6837c672ea43a0e3dc8cf (patch)
tree5e160d408935ff4955dd262aaf6eb855f18e3e74 /apps/files_sharing/tests
parentba0bab294e198f84ae038e6b50ca6a03b1ca5bdf (diff)
downloadnextcloud-server-bec1de8a385991f8ecc6837c672ea43a0e3dc8cf.tar.gz
nextcloud-server-bec1de8a385991f8ecc6837c672ea43a0e3dc8cf.zip
Update OCS Share API to use federated share provider
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/api/share20ocstest.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/api/share20ocstest.php b/apps/files_sharing/tests/api/share20ocstest.php
index 97abdca7ac3..e6a78134734 100644
--- a/apps/files_sharing/tests/api/share20ocstest.php
+++ b/apps/files_sharing/tests/api/share20ocstest.php
@@ -97,10 +97,15 @@ class Share20OCSTest extends \Test\TestCase {
public function testDeleteShareShareNotFound() {
$this->shareManager
- ->expects($this->once())
+ ->expects($this->exactly(2))
->method('getShareById')
- ->with('ocinternal:42')
- ->will($this->throwException(new \OCP\Share\Exceptions\ShareNotFound()));
+ ->will($this->returnCallback(function($id) {
+ if ($id === 'ocinternal:42' || $id === 'ocFederatedSharing:42') {
+ throw new \OCP\Share\Exceptions\ShareNotFound();
+ } else {
+ throw new \Exception();
+ }
+ }));
$expected = new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
$this->assertEquals($expected, $this->ocs->deleteShare(42));