diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-31 13:52:26 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-06 21:20:01 +0200 |
commit | 8a5af2d335da21c8f12b9f08773e95982572d40d (patch) | |
tree | 9c6376bb72cdf4dbd37c6d8a3c4de4517958909e | |
parent | 1f9622d88cf413282aefc92ddb0214d08a596082 (diff) | |
download | nextcloud-server-8a5af2d335da21c8f12b9f08773e95982572d40d.tar.gz nextcloud-server-8a5af2d335da21c8f12b9f08773e95982572d40d.zip |
Fix tests
* hasParameterOption has an additional default value which we must match
in the return map
* Fix deprecated getMock calls
-rw-r--r-- | tests/Core/Command/Config/App/GetConfigTest.php | 4 | ||||
-rw-r--r-- | tests/Core/Command/Config/System/GetConfigTest.php | 4 | ||||
-rw-r--r-- | tests/Core/Command/User/SettingTest.php | 16 |
3 files changed, 12 insertions, 12 deletions
diff --git a/tests/Core/Command/Config/App/GetConfigTest.php b/tests/Core/Command/Config/App/GetConfigTest.php index 2fac1572e37..7ea3fbb587c 100644 --- a/tests/Core/Command/Config/App/GetConfigTest.php +++ b/tests/Core/Command/Config/App/GetConfigTest.php @@ -138,8 +138,8 @@ class GetConfigTest extends TestCase { $this->consoleInput->expects($this->any()) ->method('hasParameterOption') ->willReturnMap([ - ['--output', true], - ['--default-value', $hasDefault], + ['--output', false, true], + ['--default-value', false, $hasDefault], ]); if ($expectedMessage !== null) { diff --git a/tests/Core/Command/Config/System/GetConfigTest.php b/tests/Core/Command/Config/System/GetConfigTest.php index 943cc4cfa40..fd5db69fec9 100644 --- a/tests/Core/Command/Config/System/GetConfigTest.php +++ b/tests/Core/Command/Config/System/GetConfigTest.php @@ -147,8 +147,8 @@ class GetConfigTest extends TestCase { $this->consoleInput->expects($this->any()) ->method('hasParameterOption') ->willReturnMap([ - ['--output', true], - ['--default-value', $hasDefault], + ['--output', false, true], + ['--default-value', false,$hasDefault], ]); if ($expectedMessage !== null) { diff --git a/tests/Core/Command/User/SettingTest.php b/tests/Core/Command/User/SettingTest.php index 56db670657a..784183c72c3 100644 --- a/tests/Core/Command/User/SettingTest.php +++ b/tests/Core/Command/User/SettingTest.php @@ -99,14 +99,14 @@ class SettingTest extends TestCase { [ [['uid', 'username'], ['key', 'configkey']], [['ignore-missing-user', true]], - [['--default-value', true]], + [['--default-value', false, true]], false, false, ], [ [['uid', 'username'], ['key', '']], [['ignore-missing-user', true]], - [['--default-value', true]], + [['--default-value', false, true]], false, 'The "default-value" option can only be used when specifying a key.', ], @@ -128,7 +128,7 @@ class SettingTest extends TestCase { [ [['uid', 'username'], ['key', 'configkey'], ['value', '']], [['ignore-missing-user', true]], - [['--default-value', true]], + [['--default-value', false, true]], false, 'The value argument can not be used together with "default-value".', ], @@ -164,7 +164,7 @@ class SettingTest extends TestCase { [ [['uid', 'username'], ['key', 'configkey']], [['ignore-missing-user', true], ['delete', true]], - [['--default-value', true]], + [['--default-value', false, true]], false, 'The "delete" option can not be used together with "default-value".', ], @@ -283,8 +283,8 @@ class SettingTest extends TestCase { $this->consoleInput->expects($this->atLeastOnce()) ->method('hasParameterOption') ->willReturnMap([ - ['--delete', true], - ['--error-if-not-exists', $errorIfNotExists], + ['--delete', false, true], + ['--error-if-not-exists', false, $errorIfNotExists], ]); if ($expectedLine === null) { @@ -349,7 +349,7 @@ class SettingTest extends TestCase { $this->consoleInput->expects($this->atLeastOnce()) ->method('hasParameterOption') ->willReturnMap([ - ['--update-only', $updateOnly], + ['--update-only', false, $updateOnly], ]); if ($expectedLine === null) { @@ -423,7 +423,7 @@ class SettingTest extends TestCase { $this->consoleInput->expects($this->atLeastOnce()) ->method('hasParameterOption') ->willReturnMap([ - ['--default-value', true], + ['--default-value', false, true], ]); $this->consoleInput->expects($this->once()) ->method('getOption') |