Fix JIT Config Adapter caching

This commit is contained in:
Philipp Holzer 2021-03-28 23:25:16 +02:00
commit b2a7c5ff6c
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
6 changed files with 174 additions and 4 deletions

View 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();
}
}