summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-17 10:24:19 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-23 12:10:02 +0200
commit38a260e963abd04b75aff8d67a8cf7b3b20a9c67 (patch)
treeeb118da0cdd9819657efa8fbf58c6c754c4cf19c /apps/files_external/tests
parentee649d58c5f82ee209ddc1812c1a896da53de707 (diff)
downloadnextcloud-server-38a260e963abd04b75aff8d67a8cf7b3b20a9c67.tar.gz
nextcloud-server-38a260e963abd04b75aff8d67a8cf7b3b20a9c67.zip
Revert "Implement more fine-grained external storage permissions model"
This reverts commit 0b97a05e7bd631d66de1c2aee115113ada8a5f63. This reverts commit d2e3c17c0000bc0020f1ff641190452f370434de. This reverts commit cc88c5f4b84da57c425cbdb7dc8b391b1942b503.
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r--apps/files_external/tests/controller/storagescontrollertest.php16
-rw-r--r--apps/files_external/tests/controller/userstoragescontrollertest.php16
-rw-r--r--apps/files_external/tests/service/backendservicetest.php6
3 files changed, 15 insertions, 23 deletions
diff --git a/apps/files_external/tests/controller/storagescontrollertest.php b/apps/files_external/tests/controller/storagescontrollertest.php
index c43761f3bcb..5e1deb821f4 100644
--- a/apps/files_external/tests/controller/storagescontrollertest.php
+++ b/apps/files_external/tests/controller/storagescontrollertest.php
@@ -75,12 +75,12 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$authMech = $this->getAuthMechMock();
$authMech->method('validateStorage')
->willReturn(true);
- $authMech->method('isPermitted')
+ $authMech->method('isVisibleFor')
->willReturn(true);
$backend = $this->getBackendMock();
$backend->method('validateStorage')
->willReturn(true);
- $backend->method('isPermitted')
+ $backend->method('isVisibleFor')
->willReturn(true);
$storageConfig = new StorageConfig(1);
@@ -116,12 +116,12 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$authMech = $this->getAuthMechMock();
$authMech->method('validateStorage')
->willReturn(true);
- $authMech->method('isPermitted')
+ $authMech->method('isVisibleFor')
->willReturn(true);
$backend = $this->getBackendMock();
$backend->method('validateStorage')
->willReturn(true);
- $backend->method('isPermitted')
+ $backend->method('isVisibleFor')
->willReturn(true);
$storageConfig = new StorageConfig(1);
@@ -249,12 +249,12 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$authMech = $this->getAuthMechMock();
$authMech->method('validateStorage')
->willReturn(true);
- $authMech->method('isPermitted')
+ $authMech->method('isVisibleFor')
->willReturn(true);
$backend = $this->getBackendMock();
$backend->method('validateStorage')
->willReturn(true);
- $backend->method('isPermitted')
+ $backend->method('isVisibleFor')
->willReturn(true);
$storageConfig = new StorageConfig(255);
@@ -338,13 +338,13 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$backend = $this->getBackendMock();
$backend->method('validateStorage')
->willReturn($backendValidate);
- $backend->method('isPermitted')
+ $backend->method('isVisibleFor')
->willReturn(true);
$authMech = $this->getAuthMechMock();
$authMech->method('validateStorage')
->will($this->returnValue($authMechValidate));
- $authMech->method('isPermitted')
+ $authMech->method('isVisibleFor')
->willReturn(true);
$storageConfig = new StorageConfig();
diff --git a/apps/files_external/tests/controller/userstoragescontrollertest.php b/apps/files_external/tests/controller/userstoragescontrollertest.php
index b61174b0797..9f1a8df8d2e 100644
--- a/apps/files_external/tests/controller/userstoragescontrollertest.php
+++ b/apps/files_external/tests/controller/userstoragescontrollertest.php
@@ -49,21 +49,15 @@ class UserStoragesControllerTest extends StoragesControllerTest {
}
public function testAddOrUpdateStorageDisallowedBackend() {
- $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)
+ $backend = $this->getBackendMock();
+ $backend->method('isVisibleFor')
+ ->with(BackendService::VISIBILITY_PERSONAL)
->willReturn(false);
$authMech = $this->getAuthMechMock();
$storageConfig = new StorageConfig(1);
$storageConfig->setMountPoint('mount');
- $storageConfig->setBackend($backend1);
+ $storageConfig->setBackend($backend);
$storageConfig->setAuthMechanism($authMech);
$storageConfig->setBackendOptions([]);
@@ -88,8 +82,6 @@ class UserStoragesControllerTest extends StoragesControllerTest {
$this->assertEquals(Http::STATUS_UNPROCESSABLE_ENTITY, $response->getStatus());
- $storageConfig->setBackend($backend2);
-
$response = $this->controller->update(
1,
'mount',
diff --git a/apps/files_external/tests/service/backendservicetest.php b/apps/files_external/tests/service/backendservicetest.php
index b37b5e9b466..414a9eee2ec 100644
--- a/apps/files_external/tests/service/backendservicetest.php
+++ b/apps/files_external/tests/service/backendservicetest.php
@@ -83,11 +83,11 @@ class BackendServiceTest extends \Test\TestCase {
$backendAllowed = $this->getBackendMock('\User\Mount\Allowed');
$backendAllowed->expects($this->never())
- ->method('removePermission');
+ ->method('removeVisibility');
$backendNotAllowed = $this->getBackendMock('\User\Mount\NotAllowed');
$backendNotAllowed->expects($this->once())
- ->method('removePermission')
- ->with(BackendService::USER_PERSONAL, BackendService::PERMISSION_CREATE | BackendService::PERMISSION_MOUNT);
+ ->method('removeVisibility')
+ ->with(BackendService::VISIBILITY_PERSONAL);
$backendAlias = $this->getMockBuilder('\OCA\Files_External\Lib\Backend\Backend')
->disableOriginalConstructor()