$mountPoint = substr($mountPoint, 13);
$config = array(
- 'id' => (int) $mount['id'],
- 'storage_id' => (int) $mount['storage_id'],
'class' => $mount['class'],
'mountpoint' => $mountPoint,
'backend' => $backends[$mount['class']]['backend'],
'applicable' => array('groups' => array($group), 'users' => array()),
'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
);
+ if (isset($mount['id'])) {
+ $config['id'] = (int)$mount['id'];
+ }
+ if (isset($mount['storage_id'])) {
+ $config['storage_id'] = (int)$mount['storage_id'];
+ }
if (isset($mount['mountOptions'])) {
$config['mountOptions'] = $mount['mountOptions'];
}
// Remove '/$user/files/' from mount point
$mountPoint = substr($mountPoint, 13);
$config = array(
- 'id' => (int) $mount['id'],
- 'storage_id' => (int) $mount['storage_id'],
'class' => $mount['class'],
'mountpoint' => $mountPoint,
'backend' => $backends[$mount['class']]['backend'],
'applicable' => array('groups' => array(), 'users' => array($user)),
'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
);
+ if (isset($mount['id'])) {
+ $config['id'] = (int)$mount['id'];
+ }
+ if (isset($mount['storage_id'])) {
+ $config['storage_id'] = (int)$mount['storage_id'];
+ }
if (isset($mount['mountOptions'])) {
$config['mountOptions'] = $mount['mountOptions'];
}
}
$mount['options'] = self::decryptPasswords($mount['options']);
$config = array(
- 'id' => (int) $mount['id'],
- 'storage_id' => (int) $mount['storage_id'],
'class' => $mount['class'],
// Remove '/uid/files/' from mount point
'mountpoint' => substr($mountPoint, strlen($uid) + 8),
'options' => $mount['options'],
'status' => self::getBackendStatus($mount['class'], $mount['options'], true)
);
+ if (isset($mount['id'])) {
+ $config['id'] = (int)$mount['id'];
+ }
+ if (isset($mount['storage_id'])) {
+ $config['storage_id'] = (int)$mount['storage_id'];
+ }
if (isset($mount['mountOptions'])) {
$config['mountOptions'] = $mount['mountOptions'];
}
'password' => '12345',
);
- $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', 'Test_Mount_Config_Dummy_Storage', $storageOptions, $mountType, $applicable, $isPersonal));
+ $this->assertEquals(0, OC_Mount_Config::addMountPoint('/ext', 'Test_Mount_Config_Dummy_Storage', $storageOptions, $mountType, $applicable, $isPersonal));
$config = $this->readGlobalConfig();
$this->assertEquals(1, count($config));
'password' => '12345',
);
- $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', 'Test_Mount_Config_Dummy_Storage', $storageOptions, $mountType, $applicable, $isPersonal));
+ $this->assertEquals(0, OC_Mount_Config::addMountPoint('/ext', 'Test_Mount_Config_Dummy_Storage', $storageOptions, $mountType, $applicable, $isPersonal));
$config = $this->readUserConfig();
$this->assertEquals(1, count($config));
);
// write config
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
);
// write config
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
);
// write config
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
$mountPoint,
'Test_Mount_Config_Dummy_Storage',
// edit
$mountConfig['host'] = 'anothersmbhost';
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
$mountPoint,
'Test_Mount_Config_Dummy_Storage',
);
// write config
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
);
// write config
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
);
// add mount point as "test" user
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
);
// write config
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
)
);
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
)
);
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
)
);
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
);
// write config
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
'share' => 'anothersmbshare',
'root' => 'anothersmbroot'
);
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
// Add mount points
foreach($mounts as $i => $mount) {
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
'share' => '',
);
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
$class,
$mountPoints['/'.self::TEST_USER1.'/files/ext']['priority']);
// Simulate changed mount options (without priority set)
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
$class,
);
// Create personal mount point
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
'Test_Mount_Config_Dummy_Storage',
$applicable = 'all';
$isPersonal = false;
- $this->assertTrue(
+ $this->assertEquals(
+ 0,
OC_Mount_Config::addMountPoint(
'/ext',
$storageClass,