Merge branch '2021.03-rc' into copyright-2021
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user