diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-28 14:56:13 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-05-04 10:47:43 +0200 |
commit | 5733878d6657c6e02ba3ded9e7eab4a9ba3dafe3 (patch) | |
tree | d2de6e6528a7cd1dd7d1b501e25701ff33fb0524 /apps/files_sharing | |
parent | 45a36feec68cc7530ad84521ef7c22b0536c2d3a (diff) | |
download | nextcloud-server-5733878d6657c6e02ba3ded9e7eab4a9ba3dafe3.tar.gz nextcloud-server-5733878d6657c6e02ba3ded9e7eab4a9ba3dafe3.zip |
Add tests for the correct share id on the call aswell
Diffstat (limited to 'apps/files_sharing')
-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 3a88c78220f..33a6465cf82 100644 --- a/apps/files_sharing/tests/external/managertest.php +++ b/apps/files_sharing/tests/external/managertest.php @@ -56,9 +56,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', @@ -97,6 +94,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']); @@ -128,6 +129,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']); @@ -151,6 +156,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'); |