fixing tests and preload config

This commit is contained in:
Philipp Holzer 2019-02-23 00:09:57 +01:00
parent 8d56fb8fbe
commit 1dee89f215
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
6 changed files with 12 additions and 60 deletions

View file

@ -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'));
}
}