aboutsummaryrefslogtreecommitdiff
path: root/tests/ConfigurationTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ConfigurationTest.php')
-rw-r--r--tests/ConfigurationTest.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php
index e913e463..4dcbfb8b 100644
--- a/tests/ConfigurationTest.php
+++ b/tests/ConfigurationTest.php
@@ -26,13 +26,18 @@ final class ConfigurationTest extends TestCase
public function testValueFromEnv()
{
- putenv('RSSBRIDGE_system_timezone=Europe/Berlin');
- putenv('RSSBRIDGE_TwitterV2Bridge_twitterv2apitoken=aaa');
- putenv('RSSBRIDGE_SQLiteCache_file=bbb');
- Configuration::loadConfiguration([], getenv());
+ $env = [
+ 'RSSBRIDGE_system_timezone' => 'Europe/Berlin',
+ 'RSSBRIDGE_SYSTEM_MESSAGE' => 'hello',
+ 'RSSBRIDGE_system_enabled_bridges' => 'TwitterBridge,GettrBridge',
+ 'RSSBRIDGE_system_enable_debug_mode' => 'true',
+ 'RSSBRIDGE_fileCache_path' => '/tmp/kek',
+ ];
+ Configuration::loadConfiguration([], $env);
$this->assertSame('Europe/Berlin', Configuration::getConfig('system', 'timezone'));
- $this->assertSame('aaa', Configuration::getConfig('TwitterV2Bridge', 'twitterv2apitoken'));
- $this->assertSame('bbb', Configuration::getConfig('SQLiteCache', 'file'));
- $this->assertSame('bbb', Configuration::getConfig('sqlitecache', 'file'));
+ $this->assertSame('hello', Configuration::getConfig('system', 'message'));
+ $this->assertSame(true, Configuration::getConfig('system', 'enable_debug_mode'));
+ $this->assertSame('/tmp/kek', Configuration::getConfig('FileCache', 'path'));
+ $this->assertSame(['TwitterBridge', 'GettrBridge'], Configuration::getConfig('system', 'enabled_bridges'));
}
}