diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-06-06 10:28:10 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-06-06 12:38:20 +0200 |
commit | 911fd3ead4e8ef3451aabc4b1f0cd1c7fc106e44 (patch) | |
tree | 2b1093f1beee5e871809628774859d997bc67b00 /tests | |
parent | c0a91ddca797c9821d3ce8771664b17ee588535f (diff) | |
download | nextcloud-server-911fd3ead4e8ef3451aabc4b1f0cd1c7fc106e44.tar.gz nextcloud-server-911fd3ead4e8ef3451aabc4b1f0cd1c7fc106e44.zip |
Do not allow to store boolean configs, they behave unexpected on postgres
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AllConfigTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/AllConfigTest.php b/tests/lib/AllConfigTest.php index 4f8b0658b80..3d0a9cb0827 100644 --- a/tests/lib/AllConfigTest.php +++ b/tests/lib/AllConfigTest.php @@ -123,6 +123,25 @@ class AllConfigTest extends \Test\TestCase { $config->deleteUserValue('userPreCond', 'appPreCond', 'keyPreCond'); } + public function dataSetUserValueUnexpectedValue() { + return [ + [true], + [false], + [null], + [new \stdClass()], + ]; + } + + /** + * @dataProvider dataSetUserValueUnexpectedValue + * @param mixed $value + * @expectedException \UnexpectedValueException + */ + public function testSetUserValueUnexpectedValue($value) { + $config = $this->getConfig(); + $config->setUserValue('userSetBool', 'appSetBool', 'keySetBool', $value); + } + /** * @expectedException \OCP\PreConditionNotMetException */ |