summaryrefslogtreecommitdiffstats
path: root/tests/lib/share
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-04-28 14:56:13 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-04-28 14:56:13 +0200
commitb55ef51a27e73a30e0829e273cdf111e21a77403 (patch)
tree80767fd77b51b66708983bac4fae3d54d8772521 /tests/lib/share
parent34181c3aefa4d64198736d36d7d7b0749ad03b8e (diff)
downloadnextcloud-server-b55ef51a27e73a30e0829e273cdf111e21a77403.tar.gz
nextcloud-server-b55ef51a27e73a30e0829e273cdf111e21a77403.zip
Add tests for the correct share id on the call aswell
Diffstat (limited to 'tests/lib/share')
-rw-r--r--tests/lib/share/share.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index 23274c394c6..3aec11cf6a5 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -1061,16 +1061,19 @@ class Test_Share extends \Test\TestCase {
->with($this->stringStartsWith('http://' . $urlHost . '/ocs/v1.php/cloud/shares'), $this->anything())
->willReturn(['success' => true, 'result' => json_encode(['ocs' => ['meta' => ['statuscode' => 100]]])]);
- $httpHelperMock->expects($this->at(2))
+ \OCP\Share::shareItem('test', 'test.txt', \OCP\Share::SHARE_TYPE_REMOTE, $shareWith, \OCP\Constants::PERMISSION_READ);
+ $shares = \OCP\Share::getItemShared('test', 'test.txt');
+ $share = array_shift($shares);
+
+ $httpHelperMock->expects($this->at(0))
->method('post')
- ->with($this->stringStartsWith('https://' . $urlHost . '/ocs/v1.php/cloud/shares'), $this->anything())
+ ->with($this->stringStartsWith('https://' . $urlHost . '/ocs/v1.php/cloud/shares/' . $share['id'] . '/unshare'), $this->anything())
->willReturn(['success' => false, 'result' => 'Exception']);
- $httpHelperMock->expects($this->at(3))
+ $httpHelperMock->expects($this->at(1))
->method('post')
- ->with($this->stringStartsWith('http://' . $urlHost . '/ocs/v1.php/cloud/shares'), $this->anything())
+ ->with($this->stringStartsWith('http://' . $urlHost . '/ocs/v1.php/cloud/shares/' . $share['id'] . '/unshare'), $this->anything())
->willReturn(['success' => true, 'result' => json_encode(['ocs' => ['meta' => ['statuscode' => 100]]])]);
- \OCP\Share::shareItem('test', 'test.txt', \OCP\Share::SHARE_TYPE_REMOTE, $shareWith, \OCP\Constants::PERMISSION_READ);
\OCP\Share::unshare('test', 'test.txt', \OCP\Share::SHARE_TYPE_REMOTE, $shareWith);
$this->setHttpHelper($oldHttpHelper);
}