diff options
Diffstat (limited to 'apps/files_external/tests/controller/userstoragescontrollertest.php')
-rw-r--r-- | apps/files_external/tests/controller/userstoragescontrollertest.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/files_external/tests/controller/userstoragescontrollertest.php b/apps/files_external/tests/controller/userstoragescontrollertest.php index 9f1a8df8d2e..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('isVisibleFor') - ->with(BackendService::VISIBILITY_PERSONAL) + $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', |