diff options
author | Frank Karlitschek <karlitschek@gmx.de> | 2015-03-06 00:06:50 +0300 |
---|---|---|
committer | Frank Karlitschek <karlitschek@gmx.de> | 2015-03-06 00:06:50 +0300 |
commit | a7fc0fc07b42dbd3d88cb73c1b0ab16910a1b828 (patch) | |
tree | 03363e8f9f786aa6823ba9b76cc812621322877e /tests | |
parent | eb2ac86c5d645829477b327402a9881a3d6fdf2b (diff) | |
parent | c032b94b774d9737e5af17064a2c3e61e57c609b (diff) |
Merge pull request #14719 from owncloud/fix-totally-broken-appstore
[stable8] Fix totally broken AppStore code…
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/allconfig.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lib/allconfig.php b/tests/lib/allconfig.php index 7f8ad5ec221..290e40e8d88 100644 --- a/tests/lib/allconfig.php +++ b/tests/lib/allconfig.php @@ -26,6 +26,33 @@ class TestAllConfig extends \Test\TestCase { return new \OC\AllConfig($systemConfig, $connection); } + // FIXME: Actually an integration test... – Shouldn't be in the unit test at all. + public function testGetAppsForKeyValue() { + $config = $this->getConfig(); + + // preparation - add something to the database + $data = [ + ['myFirstApp', 'key1', 'value1'], + ['mySecondApp', 'key1', 'value2'], + ['mySecondApp', 'key3', 'value2'], + ['myThirdApp', 'key3', 'value3'], + ['myThirdApp', 'key3', 'value2'], + ]; + foreach ($data as $entry) { + $config->setAppValue($entry[0], $entry[1], $entry[2]); + } + + $this->assertEquals(['mySecondApp'], $config->getAppsForKeyValue('key1', 'value2')); + $this->assertEquals(['mySecondApp', 'myThirdApp'], $config->getAppsForKeyValue('key3', 'value2')); + $this->assertEquals([], $config->getAppsForKeyValue('NotExisting', 'NotExistingValue')); + + // cleanup + foreach ($data as $entry) { + $config->deleteAppValue($entry[0], $entry[1]); + + } + } + public function testDeleteUserValue() { $config = $this->getConfig(); |