diff options
author | Joas Schilling <coding@schilljs.com> | 2016-06-14 11:31:32 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-07-13 18:43:57 +0200 |
commit | dcacdde1ea24b4e4328d313d43998d4e4515c368 (patch) | |
tree | 37da8a5c10a07a012f2bfe84b34a9966118b8252 /core | |
parent | f574a9d44f28b9d2279adbc63ae4a3a98ec19b10 (diff) | |
download | nextcloud-server-dcacdde1ea24b4e4328d313d43998d4e4515c368.tar.gz nextcloud-server-dcacdde1ea24b4e4328d313d43998d4e4515c368.zip |
Add tests for set/get/delete/list
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/User/Setting.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/core/Command/User/Setting.php b/core/Command/User/Setting.php index e2feb26cfe2..b9f7566f576 100644 --- a/core/Command/User/Setting.php +++ b/core/Command/User/Setting.php @@ -175,6 +175,7 @@ class Setting extends Base { } $this->config->setUserValue($uid, $app, $key, $input->getOption('value')); + return 0; } else if ($input->hasParameterOption('--delete')) { if ($input->hasParameterOption('--error-if-not-exists') && $value === null) { @@ -183,28 +184,25 @@ class Setting extends Base { } $this->config->deleteUserValue($uid, $app, $key); + return 0; } else if ($value !== null) { $output->writeln($value); + return 0; } else { if ($input->hasParameterOption('--default-value')) { $output->writeln($input->getOption('default-value')); + return 0; } else { $output->writeln('<error>The setting does not exist for user "' . $uid . '".</error>'); return 1; } } } else { - $this->listUserSettings($input, $output, $uid, $app); + $settings = $this->getUserSettings($uid, $app); + $this->writeArrayInOutputFormat($input, $output, $settings); + return 0; } - - return 0; - } - - protected function listUserSettings(InputInterface $input, OutputInterface $output, $uid, $app) { - $settings = $this->getUserSettings($uid, $app); - - $this->writeArrayInOutputFormat($input, $output, $settings); } protected function getUserSettings($uid, $app) { |