From faba02564a24187e69ebe274078793d66fd1a2a2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 25 Sep 2015 11:08:33 +0200 Subject: Move the filtering of sensitive data to the config class --- tests/core/command/config/listconfigstest.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'tests') 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') -- cgit v1.2.3