aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/config.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-03-13 17:43:38 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-13 17:43:38 +0100
commitfb4cf532533d99abfd1b4f40ef6319d484f6ef85 (patch)
tree7a40ddeb3ba5e6071d17eba872e056c83ef5bb43 /apps/files_external/lib/config.php
parent34c8b1ac7732b4502beebea0dfeeaa8bac225550 (diff)
downloadnextcloud-server-fb4cf532533d99abfd1b4f40ef6319d484f6ef85.tar.gz
nextcloud-server-fb4cf532533d99abfd1b4f40ef6319d484f6ef85.zip
Fix mount config unit tests
Fix expected result now that it returns the status. Added isset for some properties that are not always present.
Diffstat (limited to 'apps/files_external/lib/config.php')
-rw-r--r--apps/files_external/lib/config.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 378bedfa8de..23750dbb3fa 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -347,8 +347,6 @@ class OC_Mount_Config {
$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'],
@@ -357,6 +355,12 @@ class OC_Mount_Config {
'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'];
}
@@ -386,8 +390,6 @@ class OC_Mount_Config {
// 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'],
@@ -396,6 +398,12 @@ class OC_Mount_Config {
'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'];
}
@@ -433,8 +441,6 @@ class OC_Mount_Config {
}
$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),
@@ -442,6 +448,12 @@ class OC_Mount_Config {
'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'];
}