diff options
Diffstat (limited to 'apps/files_external/tests/service/backendservicetest.php')
-rw-r--r-- | apps/files_external/tests/service/backendservicetest.php | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/apps/files_external/tests/service/backendservicetest.php b/apps/files_external/tests/service/backendservicetest.php index 08f6b9bf988..b37b5e9b466 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('removeVisibility'); + ->method('removePermission'); $backendNotAllowed = $this->getBackendMock('\User\Mount\NotAllowed'); $backendNotAllowed->expects($this->once()) - ->method('removeVisibility') - ->with(BackendService::VISIBILITY_PERSONAL); + ->method('removePermission') + ->with(BackendService::USER_PERSONAL, BackendService::PERMISSION_CREATE | BackendService::PERMISSION_MOUNT); $backendAlias = $this->getMockBuilder('\OCA\Files_External\Lib\Backend\Backend') ->disableOriginalConstructor() @@ -126,27 +126,5 @@ class BackendServiceTest extends \Test\TestCase { $this->assertArrayNotHasKey('identifier:\Backend\NotAvailable', $availableBackends); } - public function testGetUserBackends() { - $service = new BackendService($this->config, $this->l10n); - - $backendAllowed = $this->getBackendMock('\User\Mount\Allowed'); - $backendAllowed->expects($this->once()) - ->method('isVisibleFor') - ->with(BackendService::VISIBILITY_PERSONAL) - ->will($this->returnValue(true)); - $backendNotAllowed = $this->getBackendMock('\User\Mount\NotAllowed'); - $backendNotAllowed->expects($this->once()) - ->method('isVisibleFor') - ->with(BackendService::VISIBILITY_PERSONAL) - ->will($this->returnValue(false)); - - $service->registerBackend($backendAllowed); - $service->registerBackend($backendNotAllowed); - - $userBackends = $service->getBackendsVisibleFor(BackendService::VISIBILITY_PERSONAL); - $this->assertArrayHasKey('identifier:\User\Mount\Allowed', $userBackends); - $this->assertArrayNotHasKey('identifier:\User\Mount\NotAllowed', $userBackends); - } - } |