]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Config/ConfigurationTest.php
Merge pull request #7371 from nupplaphil/task/split_cache
[friendica.git] / tests / src / Core / Config / ConfigurationTest.php
index 2e4fcd4f58db9d90a8bcb0671eb24cb9a1469e9d..fda69896fdcc0f6c505fb24ee9915d32dc5c0742 100644 (file)
@@ -1,10 +1,9 @@
 <?php
 
-namespace Friendica\Test\Core\Config;
+namespace Friendica\Test\src\Core\Config;
 
 use Friendica\Core\Config\Adapter\IConfigAdapter;
 use Friendica\Core\Config\Cache\ConfigCache;
-use Friendica\Core\Config\Cache\IConfigCache;
 use Friendica\Core\Config\Configuration;
 use Friendica\Test\MockedTest;
 
@@ -35,7 +34,7 @@ class ConfigurationTest extends MockedTest
 
                $configuration = new Configuration($configCache, $configAdapter);
 
-               $this->assertInstanceOf(IConfigCache::class, $configuration->getCache());
+               $this->assertInstanceOf(ConfigCache::class, $configuration->getCache());
        }
 
        /**
@@ -142,7 +141,7 @@ class ConfigurationTest extends MockedTest
                $this->assertNull($configuration->get('test', 'it'));
 
                /// beware that the cache returns '!<unset>!' and not null for a non existing value
-               $this->assertEquals('!<unset>!', $configuration->getCache()->get('test', 'it'));
+               $this->assertNull($configuration->getCache()->get('test', 'it'));
 
                // with default value
                $this->assertEquals('default', $configuration->get('test', 'it', 'default'));
@@ -165,7 +164,7 @@ class ConfigurationTest extends MockedTest
                $configAdapter->shouldReceive('isLoaded')->with('test', 'it')->andReturn(true)->twice();
                $configAdapter->shouldReceive('get')->with('test', 'it')->andReturn($data)->once();
                $configAdapter->shouldReceive('isLoaded')->with('test', 'not')->andReturn(false)->once();
-               $configAdapter->shouldReceive('get')->with('test', 'not')->andReturn('!<unset>!')->once();
+               $configAdapter->shouldReceive('get')->with('test', 'not')->andReturn(null)->once();
 
                $configuration = new Configuration($configCache, $configAdapter);
 
@@ -179,7 +178,7 @@ class ConfigurationTest extends MockedTest
 
                // without refresh and wrong value and default
                $this->assertEquals('default', $configuration->get('test', 'not', 'default'));
-               $this->assertEquals('!<unset>!', $configuration->getCache()->get('test', 'not'));
+               $this->assertNull($configuration->getCache()->get('test', 'not'));
        }
 
        /**
@@ -195,7 +194,7 @@ class ConfigurationTest extends MockedTest
                $configAdapter->shouldReceive('load')->andReturn([])->once();
 
                $configAdapter->shouldReceive('isLoaded')->with('test', 'it')->andReturn(false)->once();
-               $configAdapter->shouldReceive('get')->with('test', 'it')->andReturn('!<unset>!')->once();
+               $configAdapter->shouldReceive('get')->with('test', 'it')->andReturn(null)->once();
 
                $configAdapter->shouldReceive('isLoaded')->with('test', 'it')->andReturn(false)->once();
                $configAdapter->shouldReceive('get')->with('test', 'it')->andReturn($data)->once();
@@ -234,7 +233,7 @@ class ConfigurationTest extends MockedTest
 
                $this->assertTrue($configuration->delete('test', 'it'));
                $this->assertNull($configuration->get('test', 'it'));
-               $this->assertEquals('!<unset>!', $configuration->getCache()->get('test', 'it'));
+               $this->assertNull($configuration->getCache()->get('test', 'it'));
 
                $this->assertEmpty($configuration->getCache()->getAll());
        }