fixing tests and preload config
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user