diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-08 10:14:08 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-08 10:14:08 +0200 |
commit | ed92f4c4272a1681e32e2b1c33997e9c0281cca4 (patch) | |
tree | 131c688f5ff48669f33357757b043bcb41454ff3 /tests | |
parent | 12683b786dd4408a3b15c40b358bd10816066399 (diff) | |
parent | 911fd3ead4e8ef3451aabc4b1f0cd1c7fc106e44 (diff) | |
download | nextcloud-server-ed92f4c4272a1681e32e2b1c33997e9c0281cca4.tar.gz nextcloud-server-ed92f4c4272a1681e32e2b1c33997e9c0281cca4.zip |
Merge pull request #24983 from owncloud/issue-23776-do-not-allow-boolean-user-config
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 */ |