diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-31 14:01:05 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-31 14:01:05 +0100 |
commit | d64bdc0fef896496f27c07208a9cfcc66c9ce476 (patch) | |
tree | 6f685f0d9697506075d69e43b009193cca836c6f /apps | |
parent | 1e2e5abe268c501c38c1d776d4cddb076ab24110 (diff) | |
download | nextcloud-server-d64bdc0fef896496f27c07208a9cfcc66c9ce476.tar.gz nextcloud-server-d64bdc0fef896496f27c07208a9cfcc66c9ce476.zip |
Unit test storages with an empty mount point
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/tests/service/globalstoragesservicetest.php | 28 | ||||
-rw-r--r-- | apps/files_external/tests/service/userglobalstoragesservicetest.php | 5 |
2 files changed, 33 insertions, 0 deletions
diff --git a/apps/files_external/tests/service/globalstoragesservicetest.php b/apps/files_external/tests/service/globalstoragesservicetest.php index 2bc480ca312..94c34c221fc 100644 --- a/apps/files_external/tests/service/globalstoragesservicetest.php +++ b/apps/files_external/tests/service/globalstoragesservicetest.php @@ -914,4 +914,32 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { $this->assertEquals('identifier:\Auth\Mechanism', $storage2->getAuthMechanism()->getIdentifier()); } + public function testReadEmptyMountPoint() { + $configFile = $this->dataDir . '/mount.json'; + + $json = [ + 'user' => [ + 'user1' => [ + '/$user/files/' => [ + 'backend' => 'identifier:\OCA\Files_External\Lib\Backend\SFTP', + 'authMechanism' => 'identifier:\Auth\Mechanism', + 'options' => [], + 'mountOptions' => [], + ], + ] + ] + ]; + + file_put_contents($configFile, json_encode($json)); + + $allStorages = $this->service->getAllStorages(); + + $this->assertCount(1, $allStorages); + + $storage1 = $allStorages[1]; + + $this->assertEquals('/', $storage1->getMountPoint()); + } + + } diff --git a/apps/files_external/tests/service/userglobalstoragesservicetest.php b/apps/files_external/tests/service/userglobalstoragesservicetest.php index 49a02453840..b9e2c08c932 100644 --- a/apps/files_external/tests/service/userglobalstoragesservicetest.php +++ b/apps/files_external/tests/service/userglobalstoragesservicetest.php @@ -212,4 +212,9 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { $this->assertTrue(true); } + public function testReadEmptyMountPoint() { + // we don't test this here + $this->assertTrue(true); + } + } |