]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix tests
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 31 Aug 2016 11:52:26 +0000 (13:52 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 6 Sep 2016 19:20:01 +0000 (21:20 +0200)
* hasParameterOption has an additional default value which we must match
  in the return map
* Fix deprecated getMock calls

tests/Core/Command/Config/App/GetConfigTest.php
tests/Core/Command/Config/System/GetConfigTest.php
tests/Core/Command/User/SettingTest.php

index 2fac1572e37cdff755b4dec5d4ab54d6c44b3c51..7ea3fbb587c96cf8d23ba360013b2e8007f81bf5 100644 (file)
@@ -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) {
index 943cc4cfa4097242dcf04a9229e7cb0de5a88dbb..fd5db69fec975df8319943ae4030b54a2e3f352f 100644 (file)
@@ -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) {
index 56db670657ad49bb9190fcdab2866a717b950974..784183c72c3e1c96faf1359660d49dc9879c1c7c 100644 (file)
@@ -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')