diff options
-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); + } + } |