]> git.mxchange.org Git - friendica.git/commitdiff
add tests
authorPhilipp Holzer <admin@philipp.info>
Sat, 30 Mar 2019 17:57:54 +0000 (18:57 +0100)
committerPhilipp Holzer <admin@philipp.info>
Sat, 30 Mar 2019 17:57:54 +0000 (18:57 +0100)
tests/src/Core/Config/Cache/ConfigCacheTest.php

index 1ee2a3f80270aa78c673936f74d9bc20fe6db418..d8d0237f388628913fb48e53ecd4c9d44c30c0f8 100644 (file)
@@ -245,4 +245,34 @@ class ConfigCacheTest extends MockedTest
 
                $this->assertEmpty($configCache->getAll());
        }
+
+    /**
+     * Test the keyDiff() method with result
+     * @dataProvider dataTests
+     */
+       public function testKeyDiffWithResult($data)
+    {
+        $configCache = new ConfigCache($data);
+
+        $diffConfig = [
+            'fakeCat' => [
+                'fakeKey' => 'value',
+            ]
+        ];
+
+        $this->assertEquals($diffConfig, $configCache->keyDiff($diffConfig));
+    }
+
+    /**
+     * Test the keyDiff() method without result
+     * @dataProvider dataTests
+     */
+    public function testKeyDiffWithoutResult($data)
+    {
+        $configCache = new ConfigCache($data);
+
+        $diffConfig = $configCache->getAll();
+
+        $this->assertEmpty($configCache->keyDiff($diffConfig));
+    }
 }