mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-22 17:45:40 +03:00
ecb486794b
This fixes a future problem when code is placed under a namespace because `get_class($bridge)` will then return e.g. `RssBridge\Bridge\TwitterBridge` instead of the the current value `TwitterBridge`. Also a bit refactoring of `Configuration.php`.
25 lines
674 B
PHP
25 lines
674 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace RssBridge\Tests;
|
|
|
|
use Configuration;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class ConfigurationTest extends TestCase
|
|
{
|
|
public function test()
|
|
{
|
|
putenv('RSSBRIDGE_system_timezone=Europe/Berlin');
|
|
Configuration::loadConfiguration();
|
|
|
|
// test nonsense
|
|
$this->assertSame(null, Configuration::getConfig('foobar', ''));
|
|
$this->assertSame(null, Configuration::getConfig('foo', 'bar'));
|
|
$this->assertSame(null, Configuration::getConfig('cache', ''));
|
|
|
|
// test value from env
|
|
$this->assertSame('Europe/Berlin', Configuration::getConfig('system', 'timezone'));
|
|
}
|
|
}
|