Merge branch '2021.03-rc' into copyright-2021

This commit is contained in:
Balázs Úr 2021-03-29 08:45:21 +02:00 committed by GitHub
commit befc2af504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 41829 additions and 40547 deletions

View file

@ -86,7 +86,7 @@ class JitConfig extends BaseConfig
$dbvalue = $this->configModel->get($cat, $key);
if (isset($dbvalue)) {
$this->configCache->set($cat, $key, $dbvalue);
$this->configCache->set($cat, $key, $dbvalue, Cache::SOURCE_DB);
unset($dbvalue);
}
@ -105,7 +105,7 @@ class JitConfig extends BaseConfig
public function set(string $cat, string $key, $value)
{
// set the cache first
$cached = $this->configCache->set($cat, $key, $value);
$cached = $this->configCache->set($cat, $key, $value, Cache::SOURCE_DB);
// If there is no connected adapter, we're finished
if (!$this->configModel->isConnected()) {

View file

@ -81,7 +81,7 @@ class PreloadConfig extends BaseConfig
if ($this->configModel->isConnected()) {
$config = $this->configModel->get($cat, $key);
if (isset($config)) {
$this->configCache->set($cat, $key, $config);
$this->configCache->set($cat, $key, $config, Cache::SOURCE_DB);
}
}
}
@ -102,7 +102,7 @@ class PreloadConfig extends BaseConfig
}
// set the cache first
$cached = $this->configCache->set($cat, $key, $value);
$cached = $this->configCache->set($cat, $key, $value, Cache::SOURCE_DB);
// If there is no connected adapter, we're finished
if (!$this->configModel->isConnected()) {
@ -133,4 +133,18 @@ class PreloadConfig extends BaseConfig
return $cacheRemoved || $storeRemoved;
}
public function testSetDouble()
{
$this->configModel->shouldReceive('isConnected')
->andReturn(true);
// constructor loading
$this->configModel->shouldReceive('load')
->with('config')
->andReturn(['config' => ['test' => 'it']])
->once();
parent::testSetDouble();
}
}