summaryrefslogtreecommitdiffstats
path: root/tests/lib/AppConfigTest.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-12 10:49:22 +0100
committerJoas Schilling <coding@schilljs.com>2017-01-12 10:49:22 +0100
commit5dc6899d1a3e11841b62971a52f0aa8e577c3065 (patch)
treeb552bb09b3d62d3e371c19737af62ddc02f88742 /tests/lib/AppConfigTest.php
parentce7836378cf973ecebdd6d7790f9b3994f0e88f4 (diff)
downloadnextcloud-server-5dc6899d1a3e11841b62971a52f0aa8e577c3065.tar.gz
nextcloud-server-5dc6899d1a3e11841b62971a52f0aa8e577c3065.zip
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/AppConfigTest.php')
-rw-r--r--tests/lib/AppConfigTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php
index c4da7507752..fed929352d3 100644
--- a/tests/lib/AppConfigTest.php
+++ b/tests/lib/AppConfigTest.php
@@ -8,6 +8,7 @@
*/
namespace Test;
+use OCP\IConfig;
/**
* Class AppConfigTest
@@ -305,6 +306,28 @@ class AppConfigTest extends TestCase {
$this->assertEquals($expected, $values);
}
+ public function testGetFilteredValues() {
+ /** @var \OC\AppConfig|\PHPUnit_Framework_MockObject_MockObject $config */
+ $config = $this->getMockBuilder(\OC\AppConfig::class)
+ ->setConstructorArgs([\OC::$server->getDatabaseConnection()])
+ ->setMethods(['getValues'])
+ ->getMock();
+
+ $config->expects($this->once())
+ ->method('getValues')
+ ->with('user_ldap', false)
+ ->willReturn([
+ 'ldap_agent_password' => 'secret',
+ 'ldap_dn' => 'dn',
+ ]);
+
+ $values = $config->getFilteredValues('user_ldap');
+ $this->assertEquals([
+ 'ldap_agent_password' => IConfig::SENSITIVE_VALUE,
+ 'ldap_dn' => 'dn',
+ ], $values);
+ }
+
public function testSettingConfigParallel() {
$appConfig1 = new \OC\AppConfig(\OC::$server->getDatabaseConnection());
$appConfig2 = new \OC\AppConfig(\OC::$server->getDatabaseConnection());