mirror of
https://github.com/friendica/friendica
synced 2025-04-23 05:50:11 +00:00
Allow nullable UID in PConfigCache
This commit is contained in:
parent
d5de5b6789
commit
f70271aa5d
2 changed files with 33 additions and 0 deletions
|
@ -255,4 +255,21 @@ class PConfigCacheTest extends MockedTest
|
|||
$this->assertNull($configCache->get(1, 'cat2', 'key2'));
|
||||
$this->assertNull($configCache->get(2, 'cat1', 'key1'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test when using an invalid UID
|
||||
* @todo check it the clean way before using the config class
|
||||
*/
|
||||
public function testInvalidUid()
|
||||
{
|
||||
// bad UID!
|
||||
$uid = null;
|
||||
|
||||
$configCache = new PConfigCache();
|
||||
|
||||
$this->assertNull($configCache->get($uid, 'cat1', 'cat2'));
|
||||
|
||||
$this->assertFalse($configCache->set($uid, 'cat1', 'key1', 'doesn\'t matter!'));
|
||||
$this->assertFalse($configCache->delete($uid, 'cat1', 'key1'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue