mirror of
https://github.com/friendica/friendica
synced 2025-04-22 17:10:11 +00:00
fixing tests and preload config
This commit is contained in:
parent
8d56fb8fbe
commit
1dee89f215
6 changed files with 12 additions and 60 deletions
|
@ -138,22 +138,7 @@ class ConfigCacheTest extends MockedTest
|
|||
{
|
||||
$configCache = new ConfigCache();
|
||||
|
||||
$this->assertEquals('!<unset>!', $configCache->get('something', 'value'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the has() method
|
||||
*/
|
||||
public function testHas()
|
||||
{
|
||||
$configCache = new ConfigCache();
|
||||
|
||||
$this->assertFalse($configCache->has('system', 'test'));
|
||||
$this->assertFalse($configCache->has('system'));
|
||||
|
||||
$configCache->set('system', 'test', 'it');
|
||||
$this->assertTrue($configCache->has('system', 'test'));
|
||||
$this->assertTrue($configCache->has('system'));
|
||||
$this->assertNull($configCache->get('something', 'value'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,8 +156,6 @@ class ConfigCacheTest extends MockedTest
|
|||
],
|
||||
]);
|
||||
|
||||
$this->assertTrue($configCache->has('system'));
|
||||
|
||||
$this->assertEquals([
|
||||
'key1' => 'value1',
|
||||
'key2' => 'value2',
|
||||
|
@ -233,8 +216,6 @@ class ConfigCacheTest extends MockedTest
|
|||
],
|
||||
]);
|
||||
|
||||
$this->assertTrue($configCache->hasP($uid,'system'));
|
||||
|
||||
$this->assertEquals([
|
||||
'key1' => 'value1',
|
||||
'key2' => 'value2',
|
||||
|
@ -264,20 +245,4 @@ class ConfigCacheTest extends MockedTest
|
|||
|
||||
$this->assertEmpty($configCache->getAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the hasP() method
|
||||
*/
|
||||
public function testHasP()
|
||||
{
|
||||
$configCache = new ConfigCache();
|
||||
$uid = 345;
|
||||
|
||||
$this->assertFalse($configCache->hasP($uid, 'system', 'test'));
|
||||
$this->assertFalse($configCache->hasP($uid, 'system'));
|
||||
|
||||
$configCache->setP($uid, 'system', 'test', 'it');
|
||||
$this->assertTrue($configCache->hasP($uid, 'system', 'test'));
|
||||
$this->assertTrue($configCache->hasP($uid, 'system'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue