Unit test storages with an empty mount point

remotes/origin/db-empty-migrate
Robin McCorkell 2015-08-31 14:01:05 +07:00
parent 1e2e5abe26
commit d64bdc0fef
2 changed files with 33 additions and 0 deletions

@ -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());
}
}

@ -212,4 +212,9 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest {
$this->assertTrue(true);
}
public function testReadEmptyMountPoint() {
// we don't test this here
$this->assertTrue(true);
}
}