diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-21 12:46:17 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-04 15:56:50 -0500 |
commit | 95a21e2f2a7515be1d91d3f70db9cf821f872294 (patch) | |
tree | 449418a967ca1f397dad6008ba6164afb7e4e9ac /tests | |
parent | 0fcb37adcb08e8a74d712ff8a6146f91fa14d7a9 (diff) | |
download | nextcloud-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')
-rw-r--r-- | tests/lib/ConfigTest.php | 15 |
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() { |