]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Config/PreloadConfigTest.php
Merge branch '2021.03-rc' into copyright-2021
[friendica.git] / tests / src / Core / Config / PreloadConfigTest.php
index 76843bc6f08e129e4bf7c6ebb4857f56dc5181ee..d12f2dcd597c9737420469504ea630476b8eee2b 100644 (file)
@@ -162,4 +162,52 @@ class PreloadConfigTest extends ConfigTest
 
                parent::testDeleteWithDB();
        }
+
+
+       public function testSetGetHighPrio()
+       {
+               $this->configModel->shouldReceive('isConnected')
+                                                 ->andReturn(true);
+
+               // constructor loading
+               $this->configModel->shouldReceive('load')
+                                                 ->andReturn(['config' => []])
+                                                 ->once();
+
+               $this->configModel->shouldReceive('set')
+                                                 ->with('config', 'test', '123')
+                                                 ->andReturn(true)
+                                                 ->once();
+
+               $this->configModel->shouldReceive('get')
+                                                 ->with('config', 'test')
+                                                 ->andReturn('123')
+                                                 ->once();
+
+               parent::testSetGetHighPrio();
+       }
+
+       public function testSetGetLowPrio()
+       {
+               $this->configModel->shouldReceive('isConnected')
+                                                 ->andReturn(true);
+
+               // constructor loading
+               $this->configModel->shouldReceive('load')
+                                                 ->andReturn(['config' => ['test' => 'it']])
+                                                 ->once();
+
+               $this->configModel->shouldReceive('set')
+                                                 ->with('config', 'test', '123')
+                                                 ->andReturn(true)
+                                                 ->once();
+
+               // mocking one get without result
+               $this->configModel->shouldReceive('get')
+                                                 ->with('config', 'test')
+                                                 ->andReturn('it')
+                                                 ->once();
+
+               parent::testSetGetLowPrio();
+       }
 }