From 24f5a8c3a18cc46298597787e97518b114e9a742 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sat, 30 Mar 2019 18:57:54 +0100 Subject: [PATCH] add tests --- .../src/Core/Config/Cache/ConfigCacheTest.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/src/Core/Config/Cache/ConfigCacheTest.php b/tests/src/Core/Config/Cache/ConfigCacheTest.php index 1ee2a3f802..d8d0237f38 100644 --- a/tests/src/Core/Config/Cache/ConfigCacheTest.php +++ b/tests/src/Core/Config/Cache/ConfigCacheTest.php @@ -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)); + } } -- 2.39.5