diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-28 14:56:13 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-28 14:56:13 +0200 |
commit | b55ef51a27e73a30e0829e273cdf111e21a77403 (patch) | |
tree | 80767fd77b51b66708983bac4fae3d54d8772521 /apps | |
parent | 34181c3aefa4d64198736d36d7d7b0749ad03b8e (diff) | |
download | nextcloud-server-b55ef51a27e73a30e0829e273cdf111e21a77403.tar.gz nextcloud-server-b55ef51a27e73a30e0829e273cdf111e21a77403.zip |
Add tests for the correct share id on the call aswell
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/tests/external/managertest.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/external/managertest.php b/apps/files_sharing/tests/external/managertest.php index af0f1880123..f7b216530d5 100644 --- a/apps/files_sharing/tests/external/managertest.php +++ b/apps/files_sharing/tests/external/managertest.php @@ -55,9 +55,6 @@ class ManagerTest extends TestCase { } public function testAddShare() { - $this->httpHelper->expects($this->exactly(4)) - ->method('post') - ->with($this->stringStartsWith('http://localhost/ocs/v1.php/cloud/shares'), $this->anything()); $shareData1 = [ 'remote' => 'http://localhost', @@ -96,6 +93,10 @@ class ManagerTest extends TestCase { $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); + $this->httpHelper->expects($this->at(0)) + ->method('post') + ->with($this->stringStartsWith('http://localhost/ocs/v1.php/cloud/shares/' . $openShares[0]['remote_id']), $this->anything()); + // Accept the first share $this->manager->acceptShare($openShares[0]['id']); @@ -127,6 +128,10 @@ class ManagerTest extends TestCase { $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); + $this->httpHelper->expects($this->at(0)) + ->method('post') + ->with($this->stringStartsWith('http://localhost/ocs/v1.php/cloud/shares/' . $openShares[1]['remote_id'] . '/decline'), $this->anything()); + // Decline the third share $this->manager->declineShare($openShares[1]['id']); @@ -150,6 +155,13 @@ class ManagerTest extends TestCase { $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); + $this->httpHelper->expects($this->at(0)) + ->method('post') + ->with($this->stringStartsWith('http://localhost/ocs/v1.php/cloud/shares/' . $openShares[0]['remote_id'] . '/decline'), $this->anything()); + $this->httpHelper->expects($this->at(1)) + ->method('post') + ->with($this->stringStartsWith('http://localhost/ocs/v1.php/cloud/shares/' . $acceptedShares[0]['remote_id'] . '/decline'), $this->anything()); + $this->manager->removeUserShares($this->uid); $this->assertEmpty(\Test_Helper::invokePrivate($this->manager, 'getShares', [null]), 'Asserting all shares for the user have been deleted'); |