mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-08 06:19:16 +02:00
Assure that deleted cat/keys are working as expected
- A deleted cache-key would delete a merged cache-key as well - Deleting a key in the Model results in reloading the config to assure any value from underlying files
This commit is contained in:
parent
fd882abd80
commit
11a8bd17e3
5 changed files with 65 additions and 42 deletions
|
@ -576,4 +576,25 @@ class CacheTest extends MockedTest
|
|||
$cache->delete('config', 'a');
|
||||
self::assertArrayNotHasKey('config', $cache->getAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that deleted keys are working with merge
|
||||
*
|
||||
* @dataProvider dataTests
|
||||
*/
|
||||
public function testDeleteAndMergeWithDefault($data)
|
||||
{
|
||||
$cache = new Cache();
|
||||
$cache->load($data, Cache::SOURCE_FILE);
|
||||
|
||||
$cache2 = new Cache();
|
||||
$cache2->set('system', 'test', 'overrride');
|
||||
$cache2->delete('system', 'test');
|
||||
|
||||
self::assertEquals('it', $cache->get('system', 'test'));
|
||||
self::assertNull($cache2->get('system', 'test'));
|
||||
|
||||
$mergedCache = $cache->merge($cache2);
|
||||
self::assertNull($mergedCache->get('system', 'test'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue