summaryrefslogtreecommitdiffstats
path: root/tests/lib/ConfigTest.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-21 12:46:17 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-04-04 15:56:50 -0500
commit95a21e2f2a7515be1d91d3f70db9cf821f872294 (patch)
tree449418a967ca1f397dad6008ba6164afb7e4e9ac /tests/lib/ConfigTest.php
parent0fcb37adcb08e8a74d712ff8a6146f91fa14d7a9 (diff)
downloadnextcloud-server-95a21e2f2a7515be1d91d3f70db9cf821f872294.tar.gz
nextcloud-server-95a21e2f2a7515be1d91d3f70db9cf821f872294.zip
Check for boolean false and add tests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib/ConfigTest.php')
-rw-r--r--tests/lib/ConfigTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php
index 418f7de0ae1..2a4c9620340 100644
--- a/tests/lib/ConfigTest.php
+++ b/tests/lib/ConfigTest.php
@@ -52,6 +52,21 @@ class ConfigTest extends TestCase {
$this->assertEquals('bar', $this->config->getValue('foo'));
putenv('NC_foo=baz');
$this->assertEquals('baz', $this->config->getValue('foo'));
+ putenv('NC_foo'); // unset the env variable
+ }
+
+ public function testGetValueReturnsEnvironmentValueIfSetToZero() {
+ $this->assertEquals('bar', $this->config->getValue('foo'));
+ putenv('NC_foo=0');
+ $this->assertEquals('0', $this->config->getValue('foo'));
+ putenv('NC_foo'); // unset the env variable
+ }
+
+ public function testGetValueReturnsEnvironmentValueIfSetToFalse() {
+ $this->assertEquals('bar', $this->config->getValue('foo'));
+ putenv('NC_foo=false');
+ $this->assertEquals('false', $this->config->getValue('foo'));
+ putenv('NC_foo'); // unset the env variable
}
public function testSetValue() {