]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Config/PreloadConfig.php
Merge branch '2021.03-rc' into copyright-2021
[friendica.git] / src / Core / Config / PreloadConfig.php
index cca78f947ce082a2b81dc120b4a07b2e082e7864..a72fd167f17b5a9a4c9f46ad587ebd547bdcc6ef 100644 (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();
+       }
 }