mirror of
https://github.com/friendica/friendica
synced 2025-04-27 18:30:12 +00:00
Shorten "PConfiguration" to "PConfig" again, since the Wrapper is gone
This commit is contained in:
parent
cb80108957
commit
d5a473abda
41 changed files with 219 additions and 216 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Config\Cache;
|
||||
|
||||
use Friendica\Core\Config\Cache\ConfigCache;
|
||||
use Friendica\Core\Config\Cache;
|
||||
use Friendica\Test\MockedTest;
|
||||
use ParagonIE\HiddenString\HiddenString;
|
||||
|
||||
|
@ -29,7 +29,7 @@ class ConfigCacheTest extends MockedTest
|
|||
];
|
||||
}
|
||||
|
||||
private function assertConfigValues($data, ConfigCache $configCache)
|
||||
private function assertConfigValues($data, Cache $configCache)
|
||||
{
|
||||
foreach ($data as $cat => $values) {
|
||||
foreach ($values as $key => $value) {
|
||||
|
@ -44,7 +44,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testLoadConfigArray($data)
|
||||
{
|
||||
$configCache = new ConfigCache();
|
||||
$configCache = new Cache();
|
||||
$configCache->load($data);
|
||||
|
||||
$this->assertConfigValues($data, $configCache);
|
||||
|
@ -63,7 +63,7 @@ class ConfigCacheTest extends MockedTest
|
|||
]
|
||||
];
|
||||
|
||||
$configCache = new ConfigCache();
|
||||
$configCache = new Cache();
|
||||
$configCache->load($data);
|
||||
$configCache->load($override);
|
||||
|
||||
|
@ -81,7 +81,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testLoadConfigArrayWrong()
|
||||
{
|
||||
$configCache = new ConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
// empty dataset
|
||||
$configCache->load([]);
|
||||
|
@ -102,7 +102,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testGetAll($data)
|
||||
{
|
||||
$configCache = new ConfigCache();
|
||||
$configCache = new Cache();
|
||||
$configCache->load($data);
|
||||
|
||||
$all = $configCache->getAll();
|
||||
|
@ -117,7 +117,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testSetGet($data)
|
||||
{
|
||||
$configCache = new ConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
foreach ($data as $cat => $values) {
|
||||
foreach ($values as $key => $value) {
|
||||
|
@ -133,7 +133,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testGetEmpty()
|
||||
{
|
||||
$configCache = new ConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$this->assertNull($configCache->get('something', 'value'));
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testGetCat()
|
||||
{
|
||||
$configCache = new ConfigCache([
|
||||
$configCache = new Cache([
|
||||
'system' => [
|
||||
'key1' => 'value1',
|
||||
'key2' => 'value2',
|
||||
|
@ -171,7 +171,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testDelete($data)
|
||||
{
|
||||
$configCache = new ConfigCache($data);
|
||||
$configCache = new Cache($data);
|
||||
|
||||
foreach ($data as $cat => $values) {
|
||||
foreach ($values as $key => $value) {
|
||||
|
@ -188,7 +188,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testKeyDiffWithResult($data)
|
||||
{
|
||||
$configCache = new ConfigCache($data);
|
||||
$configCache = new Cache($data);
|
||||
|
||||
$diffConfig = [
|
||||
'fakeCat' => [
|
||||
|
@ -205,7 +205,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testKeyDiffWithoutResult($data)
|
||||
{
|
||||
$configCache = new ConfigCache($data);
|
||||
$configCache = new Cache($data);
|
||||
|
||||
$diffConfig = $configCache->getAll();
|
||||
|
||||
|
@ -217,7 +217,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testPasswordHide()
|
||||
{
|
||||
$configCache = new ConfigCache([
|
||||
$configCache = new Cache([
|
||||
'database' => [
|
||||
'password' => 'supersecure',
|
||||
'username' => 'notsecured',
|
||||
|
@ -234,7 +234,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testPasswordShow()
|
||||
{
|
||||
$configCache = new ConfigCache([
|
||||
$configCache = new Cache([
|
||||
'database' => [
|
||||
'password' => 'supersecure',
|
||||
'username' => 'notsecured',
|
||||
|
@ -251,7 +251,7 @@ class ConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testEmptyPassword()
|
||||
{
|
||||
$configCache = new ConfigCache([
|
||||
$configCache = new Cache([
|
||||
'database' => [
|
||||
'password' => '',
|
||||
'username' => '',
|
||||
|
@ -265,7 +265,7 @@ class ConfigCacheTest extends MockedTest
|
|||
|
||||
public function testWrongTypePassword()
|
||||
{
|
||||
$configCache = new ConfigCache([
|
||||
$configCache = new Cache([
|
||||
'database' => [
|
||||
'password' => new \stdClass(),
|
||||
'username' => '',
|
||||
|
@ -275,7 +275,7 @@ class ConfigCacheTest extends MockedTest
|
|||
$this->assertNotEmpty($configCache->get('database', 'password'));
|
||||
$this->assertEmpty($configCache->get('database', 'username'));
|
||||
|
||||
$configCache = new ConfigCache([
|
||||
$configCache = new Cache([
|
||||
'database' => [
|
||||
'password' => 23,
|
||||
'username' => '',
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Config\Cache;
|
||||
|
||||
use Friendica\Core\Config\Cache\PConfigCache;
|
||||
use Friendica\Core\PConfig\Cache;
|
||||
use Friendica\Test\MockedTest;
|
||||
|
||||
class PConfigCacheTest extends MockedTest
|
||||
|
@ -28,7 +28,7 @@ class PConfigCacheTest extends MockedTest
|
|||
];
|
||||
}
|
||||
|
||||
private function assertConfigValues($data, PConfigCache $configCache, $uid)
|
||||
private function assertConfigValues($data, Cache $configCache, $uid)
|
||||
{
|
||||
foreach ($data as $cat => $values) {
|
||||
foreach ($values as $key => $value) {
|
||||
|
@ -44,7 +44,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testSetGet($data)
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
$uid = 345;
|
||||
|
||||
foreach ($data as $cat => $values) {
|
||||
|
@ -62,7 +62,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testGetCat()
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
$uid = 345;
|
||||
|
||||
$configCache->load($uid, [
|
||||
|
@ -94,7 +94,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testDelete($data)
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
$uid = 345;
|
||||
|
||||
foreach ($data as $cat => $values) {
|
||||
|
@ -119,7 +119,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testKeyDiffWithResult($data)
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$diffConfig = [
|
||||
'fakeCat' => [
|
||||
|
@ -137,7 +137,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testKeyDiffWithoutResult($data)
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$configCache->load(1, $data);
|
||||
|
||||
|
@ -151,7 +151,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testPasswordHide()
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$configCache->load(1, [
|
||||
'database' => [
|
||||
|
@ -170,7 +170,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testPasswordShow()
|
||||
{
|
||||
$configCache = new PConfigCache(false);
|
||||
$configCache = new Cache(false);
|
||||
|
||||
$configCache->load(1, [
|
||||
'database' => [
|
||||
|
@ -189,7 +189,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testEmptyPassword()
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$configCache->load(1, [
|
||||
'database' => [
|
||||
|
@ -204,7 +204,7 @@ class PConfigCacheTest extends MockedTest
|
|||
|
||||
public function testWrongTypePassword()
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$configCache->load(1, [
|
||||
'database' => [
|
||||
|
@ -216,7 +216,7 @@ class PConfigCacheTest extends MockedTest
|
|||
$this->assertNotEmpty($configCache->get(1, 'database', 'password'));
|
||||
$this->assertEmpty($configCache->get(1, 'database', 'username'));
|
||||
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$configCache->load(1, [
|
||||
'database' => [
|
||||
|
@ -234,7 +234,7 @@ class PConfigCacheTest extends MockedTest
|
|||
*/
|
||||
public function testTwoUid()
|
||||
{
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$configCache->load(1, [
|
||||
'cat1' => [
|
||||
|
@ -265,7 +265,7 @@ class PConfigCacheTest extends MockedTest
|
|||
// bad UID!
|
||||
$uid = null;
|
||||
|
||||
$configCache = new PConfigCache();
|
||||
$configCache = new Cache();
|
||||
|
||||
$this->assertNull($configCache->get($uid, 'cat1', 'cat2'));
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Config;
|
||||
|
||||
use Friendica\Core\Config\Cache\ConfigCache;
|
||||
use Friendica\Core\Config\Cache;
|
||||
use Friendica\Core\Config\IConfig;
|
||||
use Friendica\Model\Config\Config as ConfigModel;
|
||||
use Friendica\Test\MockedTest;
|
||||
|
@ -14,7 +14,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
/** @var ConfigModel|MockInterface */
|
||||
protected $configModel;
|
||||
|
||||
/** @var ConfigCache */
|
||||
/** @var Cache */
|
||||
protected $configCache;
|
||||
|
||||
/** @var IConfig */
|
||||
|
@ -42,7 +42,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
|
||||
// Create the config model
|
||||
$this->configModel = Mockery::mock(ConfigModel::class);
|
||||
$this->configCache = new ConfigCache();
|
||||
$this->configCache = new Cache();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,7 +142,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
->once();
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
// assert config is loaded everytime
|
||||
$this->assertConfig('config', $data['config']);
|
||||
|
@ -154,7 +154,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
public function testLoad(array $data, array $possibleCats, array $load)
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
foreach ($load as $loadedCats) {
|
||||
$this->testedConfig->load($loadedCats);
|
||||
|
@ -235,7 +235,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
public function testCacheLoadDouble(array $data1, array $data2, array $expect)
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
foreach ($data1 as $cat => $data) {
|
||||
$this->testedConfig->load($cat);
|
||||
|
@ -260,7 +260,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
$this->configModel->shouldReceive('load')->withAnyArgs()->andReturn([])->once();
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertEmpty($this->testedConfig->getCache()->getAll());
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
->times(3);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertTrue($this->testedConfig->set('test', 'it', $data));
|
||||
|
||||
|
@ -295,7 +295,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
$this->configModel->shouldReceive('set')->with('test', 'it', $data)->andReturn(true)->once();
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertTrue($this->testedConfig->set('test', 'it', $data));
|
||||
|
||||
|
@ -309,7 +309,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
public function testGetWrongWithoutDB()
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
// without refresh
|
||||
$this->assertNull($this->testedConfig->get('test', 'it'));
|
||||
|
@ -334,7 +334,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
$this->configCache->load(['test' => ['it' => 'now']]);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
// without refresh
|
||||
$this->assertEquals('now', $this->testedConfig->get('test', 'it'));
|
||||
|
@ -359,7 +359,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
$this->configCache->load(['test' => ['it' => $data]]);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertEquals($data, $this->testedConfig->get('test', 'it'));
|
||||
$this->assertEquals($data, $this->testedConfig->getCache()->get('test', 'it'));
|
||||
|
@ -396,7 +396,7 @@ abstract class ConfigurationTest extends MockedTest
|
|||
->once();
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(ConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
// directly set the value to the cache
|
||||
$this->testedConfig->getCache()->set('test', 'it', 'now');
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Config;
|
||||
|
||||
use Friendica\Core\Config\JitPConfiguration;
|
||||
use Friendica\Core\PConfig\JitPConfig;
|
||||
|
||||
class JitPConfigurationTest extends PConfigurationTest
|
||||
{
|
||||
public function getInstance()
|
||||
{
|
||||
return new JitPConfiguration($this->configCache, $this->configModel);
|
||||
return new JitPConfig($this->configCache, $this->configModel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Config;
|
||||
|
||||
use Friendica\Core\Config\Cache\PConfigCache;
|
||||
use Friendica\Core\Config\PConfiguration;
|
||||
use Friendica\Core\PConfig\Cache;
|
||||
use Friendica\Core\BasePConfig;
|
||||
use Friendica\Model\Config\PConfig as PConfigModel;
|
||||
use Friendica\Test\MockedTest;
|
||||
use Mockery;
|
||||
|
@ -14,10 +14,10 @@ abstract class PConfigurationTest extends MockedTest
|
|||
/** @var PConfigModel|MockInterface */
|
||||
protected $configModel;
|
||||
|
||||
/** @var PConfigCache */
|
||||
/** @var Cache */
|
||||
protected $configCache;
|
||||
|
||||
/** @var PConfiguration */
|
||||
/** @var BasePConfig */
|
||||
protected $testedConfig;
|
||||
|
||||
/**
|
||||
|
@ -44,11 +44,11 @@ abstract class PConfigurationTest extends MockedTest
|
|||
|
||||
// Create the config model
|
||||
$this->configModel = Mockery::mock(PConfigModel::class);
|
||||
$this->configCache = new PConfigCache();
|
||||
$this->configCache = new Cache();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PConfiguration
|
||||
* @return BasePConfig
|
||||
*/
|
||||
public abstract function getInstance();
|
||||
|
||||
|
@ -145,7 +145,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
public function testSetUp(int $uid, array $data)
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertEmpty($this->testedConfig->getCache()->getAll());
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
public function testLoad(int $uid, array $data, array $possibleCats, array $load)
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
foreach ($load as $loadedCats) {
|
||||
$this->testedConfig->load($uid, $loadedCats);
|
||||
|
@ -239,7 +239,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
public function testCacheLoadDouble(int $uid, array $data1, array $data2, array $expect)
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
foreach ($data1 as $cat => $data) {
|
||||
$this->testedConfig->load($uid, $cat);
|
||||
|
@ -263,7 +263,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
public function testSetGetWithoutDB(int $uid, $data)
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertTrue($this->testedConfig->set($uid, 'test', 'it', $data));
|
||||
|
||||
|
@ -284,7 +284,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
->once();
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertTrue($this->testedConfig->set($uid, 'test', 'it', $data));
|
||||
|
||||
|
@ -298,7 +298,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
public function testGetWrongWithoutDB()
|
||||
{
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
// without refresh
|
||||
$this->assertNull($this->testedConfig->get(0, 'test', 'it'));
|
||||
|
@ -323,7 +323,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
$this->configCache->load($uid, ['test' => ['it' => 'now']]);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
// without refresh
|
||||
$this->assertEquals('now', $this->testedConfig->get($uid, 'test', 'it'));
|
||||
|
@ -348,7 +348,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
$this->configCache->load($uid, ['test' => ['it' => $data]]);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertEquals($data, $this->testedConfig->get($uid, 'test', 'it'));
|
||||
$this->assertEquals($data, $this->testedConfig->getCache()->get($uid, 'test', 'it'));
|
||||
|
@ -387,7 +387,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
->once();
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
// directly set the value to the cache
|
||||
$this->testedConfig->getCache()->set($uid, 'test', 'it', 'now');
|
||||
|
@ -447,7 +447,7 @@ abstract class PConfigurationTest extends MockedTest
|
|||
$this->configCache->load($data2['uid'], $data2['data']);
|
||||
|
||||
$this->testedConfig = $this->getInstance();
|
||||
$this->assertInstanceOf(PConfigCache::class, $this->testedConfig->getCache());
|
||||
$this->assertInstanceOf(Cache::class, $this->testedConfig->getCache());
|
||||
|
||||
$this->assertConfig($data1['uid'], 'cat1', $data1['data']['cat1']);
|
||||
$this->assertConfig($data1['uid'], 'cat2', $data1['data']['cat2']);
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Config;
|
||||
|
||||
use Friendica\Core\Config\PreloadPConfiguration;
|
||||
use Friendica\Core\PConfig\PreloadPConfig;
|
||||
|
||||
class PreloadPConfigurationTest extends PConfigurationTest
|
||||
{
|
||||
public function getInstance()
|
||||
{
|
||||
return new PreloadPConfiguration($this->configCache, $this->configModel);
|
||||
return new PreloadPConfig($this->configCache, $this->configModel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
namespace Friendica\Core;
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\Core\Config\Cache\ConfigCache;
|
||||
use Friendica\Core\Config\Cache;
|
||||
use Friendica\DI;
|
||||
use Friendica\Network\CurlResult;
|
||||
use Friendica\Test\MockedTest;
|
||||
|
@ -419,7 +419,7 @@ class InstallerTest extends MockedTest
|
|||
$this->l10nMock->shouldReceive('t')->andReturnUsing(function ($args) { return $args; });
|
||||
|
||||
$install = new Installer();
|
||||
$configCache = \Mockery::mock(ConfigCache::class);
|
||||
$configCache = \Mockery::mock(Cache::class);
|
||||
$configCache->shouldReceive('set')->with('config', 'php_path', \Mockery::any())->once();
|
||||
$configCache->shouldReceive('set')->with('system', 'basepath', '/test/')->once();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue