summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-06-13 16:04:38 +0200
committerJoas Schilling <coding@schilljs.com>2016-07-13 18:43:50 +0200
commit01899b8cf1f8b00aae72798cdb02ad71b1972288 (patch)
tree2b070cdb62f2e9c80c245cbad972ee39736a522d /core/Command
parentdb6dba96194a63eeb68c5240da0bf686f79a0c59 (diff)
downloadnextcloud-server-01899b8cf1f8b00aae72798cdb02ad71b1972288.tar.gz
nextcloud-server-01899b8cf1f8b00aae72798cdb02ad71b1972288.zip
Add tests for checkInput()
Diffstat (limited to 'core/Command')
-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".');
}
}