+ // second run is not loaded, but now data is found in the db (overwrote cache)
+ $this->assertEquals($data, $configuration->get('test', 'it'));
+ $this->assertEquals($data, $configuration->getCache()->get('test', 'it'));
+
+ // third run is loaded and therefore cache is used
+ $this->assertEquals($data, $configuration->get('test', 'it'));
+ $this->assertEquals($data, $configuration->getCache()->get('test', 'it'));
+ }
+
+ /**
+ * Test the configuration delete() method without adapter
+ * @dataProvider dataTests
+ */
+ public function testDeleteWithoutDB($data)
+ {
+ $configCache = new ConfigCache(['test' => ['it' => $data]]);
+ $configAdapter = \Mockery::mock(IConfigAdapter::class);
+ $configAdapter->shouldReceive('isConnected')->andReturn(false)->times(4);
+
+ $configuration = new Configuration($configCache, $configAdapter);
+
+ $this->assertEquals($data, $configuration->get('test', 'it'));
+ $this->assertEquals($data, $configuration->getCache()->get('test', 'it'));
+