]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Config/JitConfigTest.php
Merge branch '2021.03-rc' into copyright-2021
[friendica.git] / tests / src / Core / Config / JitConfigTest.php
index 648fa07297d1b100c81611401b34328bf9db239d..62c5effda6e9d74635f08a8f37f238ac58034586 100644 (file)
@@ -198,4 +198,58 @@ class JitConfigTest extends ConfigTest
 
                parent::testDeleteWithDB();
        }
+
+       public function testSetGetHighPrio()
+       {
+               $this->configModel->shouldReceive('isConnected')
+                                                 ->andReturn(true);
+
+               // constructor loading
+               $this->configModel->shouldReceive('load')
+                                                 ->with('config')
+                                                 ->andReturn(['config' => []])
+                                                 ->once();
+
+               $this->configModel->shouldReceive('get')
+                                                 ->with('config', 'test')
+                                                 ->andReturn('prio')
+                                                 ->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')
+                                                 ->with('config')
+                                                 ->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();
+       }
 }