Introduce Config\Cache Source indicators (File, DB, Server Env)

This commit is contained in:
Philipp 2020-10-04 20:37:35 +02:00
parent 50a0927e7e
commit 0f3e4255ca
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
6 changed files with 56 additions and 45 deletions

View file

@ -83,13 +83,14 @@ class CacheTest extends MockedTest
];
$configCache = new Cache();
$configCache->load($data);
$configCache->load($override);
$configCache->load($data, Cache::SOURCE_DB);
// doesn't override - Low Priority due Config file
$configCache->load($override, Cache::SOURCE_FILE);
$this->assertConfigValues($data, $configCache);
// override the value
$configCache->load($override, true);
// override the value - High Prio due Server Env
$configCache->load($override, Cache::SOURCE_ENV);
$this->assertEquals($override['system']['test'], $configCache->get('system', 'test'));
$this->assertEquals($override['system']['boolTrue'], $configCache->get('system', 'boolTrue'));