mirror of
https://github.com/friendica/friendica
synced 2025-04-27 18:30:12 +00:00
Introduce Config\Cache Source indicators (File, DB, Server Env)
This commit is contained in:
parent
50a0927e7e
commit
0f3e4255ca
6 changed files with 56 additions and 45 deletions
|
@ -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'));
|
||||
|
|
|
@ -350,7 +350,7 @@ abstract class ConfigTest extends MockedTest
|
|||
*/
|
||||
public function testGetWithRefresh($data)
|
||||
{
|
||||
$this->configCache->load(['test' => ['it' => 'now']]);
|
||||
$this->configCache->load(['test' => ['it' => 'now']], Cache::SOURCE_FILE);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
@ -375,7 +375,7 @@ abstract class ConfigTest extends MockedTest
|
|||
*/
|
||||
public function testDeleteWithoutDB($data)
|
||||
{
|
||||
$this->configCache->load(['test' => ['it' => $data]]);
|
||||
$this->configCache->load(['test' => ['it' => $data]], Cache::SOURCE_FILE);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
@ -395,7 +395,7 @@ abstract class ConfigTest extends MockedTest
|
|||
*/
|
||||
public function testDeleteWithDB()
|
||||
{
|
||||
$this->configCache->load(['test' => ['it' => 'now', 'quarter' => 'true']]);
|
||||
$this->configCache->load(['test' => ['it' => 'now', 'quarter' => 'true']], Cache::SOURCE_FILE);
|
||||
|
||||
$this->configModel->shouldReceive('delete')
|
||||
->with('test', 'it')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue