summaryrefslogtreecommitdiffstats
path: root/tests/lib/ConfigTest.php
diff options
context:
space:
mode:
authorPhilipp Schaffrath <github@philipp.schaffrath.email>2017-01-24 12:18:29 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-04-04 15:56:50 -0500
commit695a17804ed261980e9c3c20a588c1f3a3a3507f (patch)
treeb88fc16ee374cf2ee0c00aa00eeacaa84ea6e9fb /tests/lib/ConfigTest.php
parentfa4107893de4e94020dc1b3182cfea969b5db1a6 (diff)
downloadnextcloud-server-695a17804ed261980e9c3c20a588c1f3a3a3507f.tar.gz
nextcloud-server-695a17804ed261980e9c3c20a588c1f3a3a3507f.zip
Override config.php values through ENV variables (#26570)
* added functionality to override config.php values with 'OC_' prefixed environment variables * use getenv to read environment variables since apache does not set $_ENV variables, fixed test Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib/ConfigTest.php')
-rw-r--r--tests/lib/ConfigTest.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php
index 74dcdc192ce..f7add114aa8 100644
--- a/tests/lib/ConfigTest.php
+++ b/tests/lib/ConfigTest.php
@@ -48,6 +48,12 @@ class ConfigTest extends TestCase {
$this->assertSame(array('Appenzeller', 'Guinness', 'Kölsch'), $this->config->getValue('beers'));
}
+ public function testGetValueReturnsEnvironmentValueIfSet() {
+ $this->assertEquals('bar', $this->config->getValue('foo'));
+ putenv('OC_foo=baz');
+ $this->assertEquals('baz', $this->config->getValue('foo'));
+ }
+
public function testSetValue() {
$this->config->setValue('foo', 'moo');
$expectedConfig = $this->initialConfig;