mirror of
https://github.com/friendica/friendica
synced 2025-05-11 07:44:16 +02: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;
|
||||
|
||||
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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue