aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-09-25 11:08:33 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-25 11:08:33 +0200
commitfaba02564a24187e69ebe274078793d66fd1a2a2 (patch)
tree204c7294e0a1a61e54c01e233a70e1f922967d48 /tests
parentbf73665a35470432ae939a70eb91ecf9f8933240 (diff)
downloadnextcloud-server-faba02564a24187e69ebe274078793d66fd1a2a2.tar.gz
nextcloud-server-faba02564a24187e69ebe274078793d66fd1a2a2.zip
Move the filtering of sensitive data to the config class
Diffstat (limited to 'tests')
-rw-r--r--tests/core/command/config/listconfigstest.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/core/command/config/listconfigstest.php b/tests/core/command/config/listconfigstest.php
index 7492701cce3..bde6a1b0db3 100644
--- a/tests/core/command/config/listconfigstest.php
+++ b/tests/core/command/config/listconfigstest.php
@@ -23,6 +23,7 @@ namespace Tests\Core\Command\Config;
use OC\Core\Command\Config\ListConfigs;
+use OCP\IConfig;
use Test\TestCase;
class ListConfigsTest extends TestCase {
@@ -66,7 +67,7 @@ class ListConfigsTest extends TestCase {
'overwrite.cli.url',
],
[
- ['secret', 'N;', 'my secret'],
+ ['secret', 'N;', IConfig::SENSITIVE_VALUE],
['overwrite.cli.url', 'N;', 'http://localhost'],
],
// app config
@@ -81,7 +82,7 @@ class ListConfigsTest extends TestCase {
false,
json_encode([
'system' => [
- 'secret' => ListConfigs::SENSITIVE_VALUE,
+ 'secret' => IConfig::SENSITIVE_VALUE,
'overwrite.cli.url' => 'http://localhost',
],
'apps' => [
@@ -139,12 +140,12 @@ class ListConfigsTest extends TestCase {
'overwrite.cli.url',
],
[
- ['secret', 'N;', 'my secret'],
+ ['secret', 'N;', IConfig::SENSITIVE_VALUE],
['objectstore', 'N;', [
'class' => 'OC\\Files\\ObjectStore\\Swift',
'arguments' => [
'username' => 'facebook100000123456789',
- 'password' => 'Secr3tPaSSWoRdt7',
+ 'password' => IConfig::SENSITIVE_VALUE,
],
]],
['overwrite.cli.url', 'N;', 'http://localhost'],
@@ -161,12 +162,12 @@ class ListConfigsTest extends TestCase {
false,
json_encode([
'system' => [
- 'secret' => ListConfigs::SENSITIVE_VALUE,
+ 'secret' => IConfig::SENSITIVE_VALUE,
'objectstore' => [
'class' => 'OC\\Files\\ObjectStore\\Swift',
'arguments' => [
'username' => 'facebook100000123456789',
- 'password' => ListConfigs::SENSITIVE_VALUE,
+ 'password' => IConfig::SENSITIVE_VALUE,
],
],
'overwrite.cli.url' => 'http://localhost',
@@ -276,9 +277,15 @@ class ListConfigsTest extends TestCase {
$this->systemConfig->expects($this->any())
->method('getKeys')
->willReturn($systemConfigs);
- $this->systemConfig->expects($this->any())
- ->method('getValue')
- ->willReturnMap($systemConfigMap);
+ if ($private) {
+ $this->systemConfig->expects($this->any())
+ ->method('getValue')
+ ->willReturnMap($systemConfigMap);
+ } else {
+ $this->systemConfig->expects($this->any())
+ ->method('getFilteredValue')
+ ->willReturnMap($systemConfigMap);
+ }
$this->appConfig->expects($this->any())
->method('getApps')