Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-06-13 17:04:38 +0300
committerJoas Schilling <coding@schilljs.com>2016-07-13 19:43:50 +0300
commit01899b8cf1f8b00aae72798cdb02ad71b1972288 (patch)
tree2b070cdb62f2e9c80c245cbad972ee39736a522d /core
parentdb6dba96194a63eeb68c5240da0bf686f79a0c59 (diff)
Add tests for checkInput()
Diffstat (limited to 'core')
-rw-r--r--core/Command/User/Setting.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/Command/User/Setting.php b/core/Command/User/Setting.php
index a5ce74b5a79..e2feb26cfe2 100644
--- a/core/Command/User/Setting.php
+++ b/core/Command/User/Setting.php
@@ -136,20 +136,20 @@ class Setting extends Base {
if ($input->hasParameterOption('--value') && $input->hasParameterOption('--default-value')) {
throw new \InvalidArgumentException('The "value" option can not be used together with "default-value".');
}
- if ($input->hasParameterOption('--update-only') && !$input->hasParameterOption('--value')) {
+ if ($input->getOption('update-only') && !$input->hasParameterOption('--value')) {
throw new \InvalidArgumentException('The "update-only" option can only be used together with "value".');
}
- if ($input->getArgument('key') === '' && $input->hasParameterOption('--delete')) {
+ if ($input->getArgument('key') === '' && $input->getOption('delete')) {
throw new \InvalidArgumentException('The "delete" option can only be used when specifying a key.');
}
- if ($input->hasParameterOption('--delete') && $input->hasParameterOption('--default-value')) {
- throw new \InvalidArgumentException('The "value" option can not be used together with "default-value".');
+ if ($input->getOption('delete') && $input->hasParameterOption('--default-value')) {
+ throw new \InvalidArgumentException('The "delete" option can not be used together with "default-value".');
}
- if ($input->hasParameterOption('--delete') && $input->hasParameterOption('--value')) {
- throw new \InvalidArgumentException('The "value" option can not be used together with "value".');
+ if ($input->getOption('delete') && $input->hasParameterOption('--value')) {
+ throw new \InvalidArgumentException('The "delete" option can not be used together with "value".');
}
- if ($input->hasParameterOption('--error-if-not-exists') && !$input->hasParameterOption('--delete')) {
+ if ($input->getOption('error-if-not-exists') && !$input->getOption('delete')) {
throw new \InvalidArgumentException('The "error-if-not-exists" option can only be used together with "delete".');
}
}