diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-28 16:15:21 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-28 17:28:44 +0100 |
commit | f0c8cfa9a6a5db7134a2490cc562ff2623ce685d (patch) | |
tree | 6670e881866d4503fb96b4ba269e1e7edd7fe0af /apps/files_external/tests | |
parent | cc88c5f4b84da57c425cbdb7dc8b391b1942b503 (diff) | |
download | nextcloud-server-f0c8cfa9a6a5db7134a2490cc562ff2623ce685d.tar.gz nextcloud-server-f0c8cfa9a6a5db7134a2490cc562ff2623ce685d.zip |
Validate permissions for created admin storages, auth mechanism
Backend and auth mechanism permissions are checked on storage creation,
both for personal storages and for admin storages
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r-- | apps/files_external/tests/controller/storagescontrollertest.php | 8 | ||||
-rw-r--r-- | apps/files_external/tests/controller/userstoragescontrollertest.php | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_external/tests/controller/storagescontrollertest.php b/apps/files_external/tests/controller/storagescontrollertest.php index 5a2cff99244..c43761f3bcb 100644 --- a/apps/files_external/tests/controller/storagescontrollertest.php +++ b/apps/files_external/tests/controller/storagescontrollertest.php @@ -75,6 +75,8 @@ abstract class StoragesControllerTest extends \Test\TestCase { $authMech = $this->getAuthMechMock(); $authMech->method('validateStorage') ->willReturn(true); + $authMech->method('isPermitted') + ->willReturn(true); $backend = $this->getBackendMock(); $backend->method('validateStorage') ->willReturn(true); @@ -114,6 +116,8 @@ abstract class StoragesControllerTest extends \Test\TestCase { $authMech = $this->getAuthMechMock(); $authMech->method('validateStorage') ->willReturn(true); + $authMech->method('isPermitted') + ->willReturn(true); $backend = $this->getBackendMock(); $backend->method('validateStorage') ->willReturn(true); @@ -245,6 +249,8 @@ abstract class StoragesControllerTest extends \Test\TestCase { $authMech = $this->getAuthMechMock(); $authMech->method('validateStorage') ->willReturn(true); + $authMech->method('isPermitted') + ->willReturn(true); $backend = $this->getBackendMock(); $backend->method('validateStorage') ->willReturn(true); @@ -338,6 +344,8 @@ abstract class StoragesControllerTest extends \Test\TestCase { $authMech = $this->getAuthMechMock(); $authMech->method('validateStorage') ->will($this->returnValue($authMechValidate)); + $authMech->method('isPermitted') + ->willReturn(true); $storageConfig = new StorageConfig(); $storageConfig->setMountPoint('mount'); diff --git a/apps/files_external/tests/controller/userstoragescontrollertest.php b/apps/files_external/tests/controller/userstoragescontrollertest.php index b9668064e33..720e59cff93 100644 --- a/apps/files_external/tests/controller/userstoragescontrollertest.php +++ b/apps/files_external/tests/controller/userstoragescontrollertest.php @@ -51,7 +51,7 @@ class UserStoragesControllerTest extends StoragesControllerTest { public function testAddOrUpdateStorageDisallowedBackend() { $backend = $this->getBackendMock(); $backend->method('isPermitted') - ->with(BackendService::USER_PERSONAL, BackendService::PERMISSION_MOUNT) + ->with(BackendService::USER_PERSONAL, BackendService::PERMISSION_CREATE) ->willReturn(false); $authMech = $this->getAuthMechMock(); |