summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/controller
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-28 16:50:10 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-28 17:43:30 +0100
commitd2e3c17c0000bc0020f1ff641190452f370434de (patch)
tree6fd57b85c452a84fc8ea73cc5c50e5969643edda /apps/files_external/tests/controller
parentf0c8cfa9a6a5db7134a2490cc562ff2623ce685d (diff)
downloadnextcloud-server-d2e3c17c0000bc0020f1ff641190452f370434de.tar.gz
nextcloud-server-d2e3c17c0000bc0020f1ff641190452f370434de.zip
Introduce MODIFY permission for external storages
Diffstat (limited to 'apps/files_external/tests/controller')
-rw-r--r--apps/files_external/tests/controller/userstoragescontrollertest.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_external/tests/controller/userstoragescontrollertest.php b/apps/files_external/tests/controller/userstoragescontrollertest.php
index 720e59cff93..b61174b0797 100644
--- a/apps/files_external/tests/controller/userstoragescontrollertest.php
+++ b/apps/files_external/tests/controller/userstoragescontrollertest.php
@@ -49,15 +49,21 @@ class UserStoragesControllerTest extends StoragesControllerTest {
}
public function testAddOrUpdateStorageDisallowedBackend() {
- $backend = $this->getBackendMock();
- $backend->method('isPermitted')
+ $backend1 = $this->getBackendMock();
+ $backend1->expects($this->once())
+ ->method('isPermitted')
->with(BackendService::USER_PERSONAL, BackendService::PERMISSION_CREATE)
->willReturn(false);
+ $backend2 = $this->getBackendMock();
+ $backend2->expects($this->once())
+ ->method('isPermitted')
+ ->with(BackendService::USER_PERSONAL, BackendService::PERMISSION_MODIFY)
+ ->willReturn(false);
$authMech = $this->getAuthMechMock();
$storageConfig = new StorageConfig(1);
$storageConfig->setMountPoint('mount');
- $storageConfig->setBackend($backend);
+ $storageConfig->setBackend($backend1);
$storageConfig->setAuthMechanism($authMech);
$storageConfig->setBackendOptions([]);
@@ -82,6 +88,8 @@ class UserStoragesControllerTest extends StoragesControllerTest {
$this->assertEquals(Http::STATUS_UNPROCESSABLE_ENTITY, $response->getStatus());
+ $storageConfig->setBackend($backend2);
+
$response = $this->controller->update(
1,
'mount',