diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-02-01 17:44:58 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-02-02 15:10:59 +0100 |
commit | f4e1a1677ba6436f089cc8ad6aee5c06e71c4177 (patch) | |
tree | de990e79ab83f4d805c386b3eb2cb032bbeba246 /apps/files_external/tests | |
parent | 2d1d89ee29e49412192b051412755610e0538198 (diff) | |
download | nextcloud-server-f4e1a1677ba6436f089cc8ad6aee5c06e71c4177.tar.gz nextcloud-server-f4e1a1677ba6436f089cc8ad6aee5c06e71c4177.zip |
Remove magic flags from files_external backend params
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r-- | apps/files_external/tests/definitionparameterttest.php | 24 | ||||
-rw-r--r-- | apps/files_external/tests/js/settingsSpec.js | 48 |
2 files changed, 58 insertions, 14 deletions
diff --git a/apps/files_external/tests/definitionparameterttest.php b/apps/files_external/tests/definitionparameterttest.php index dc7c150ec96..e89058d5c78 100644 --- a/apps/files_external/tests/definitionparameterttest.php +++ b/apps/files_external/tests/definitionparameterttest.php @@ -27,18 +27,34 @@ class DefinitionParameterTest extends \Test\TestCase { public function testJsonSerialization() { $param = new Param('foo', 'bar'); - $this->assertEquals('bar', $param->jsonSerialize()); + $this->assertEquals([ + 'value' => 'bar', + 'flags' => 0, + 'type' => 0 + ], $param->jsonSerialize()); $param->setType(Param::VALUE_BOOLEAN); - $this->assertEquals('!bar', $param->jsonSerialize()); + $this->assertEquals([ + 'value' => 'bar', + 'flags' => 0, + 'type' => Param::VALUE_BOOLEAN + ], $param->jsonSerialize()); $param->setType(Param::VALUE_PASSWORD); $param->setFlag(Param::FLAG_OPTIONAL); - $this->assertEquals('&*bar', $param->jsonSerialize()); + $this->assertEquals([ + 'value' => 'bar', + 'flags' => Param::FLAG_OPTIONAL, + 'type' => Param::VALUE_PASSWORD + ], $param->jsonSerialize()); $param->setType(Param::VALUE_HIDDEN); $param->setFlags(Param::FLAG_NONE); - $this->assertEquals('#bar', $param->jsonSerialize()); + $this->assertEquals([ + 'value' => 'bar', + 'flags' => Param::FLAG_NONE, + 'type' => Param::VALUE_HIDDEN + ], $param->jsonSerialize()); } public function validateValueProvider() { diff --git a/apps/files_external/tests/js/settingsSpec.js b/apps/files_external/tests/js/settingsSpec.js index 72b186edf06..6f5bb2a8e3e 100644 --- a/apps/files_external/tests/js/settingsSpec.js +++ b/apps/files_external/tests/js/settingsSpec.js @@ -58,8 +58,13 @@ describe('OCA.External.Settings tests', function() { 'identifier': '\\OC\\TestBackend', 'name': 'Test Backend', 'configuration': { - 'field1': 'Display Name 1', - 'field2': '&Display Name 2' + 'field1': { + 'value': 'Display Name 1' + }, + 'field2': { + 'value': 'Display Name 2', + 'flags': 1 + } }, 'authSchemes': { 'builtin': true, @@ -70,8 +75,13 @@ describe('OCA.External.Settings tests', function() { 'identifier': '\\OC\\AnotherTestBackend', 'name': 'Another Test Backend', 'configuration': { - 'field1': 'Display Name 1', - 'field2': '&Display Name 2' + 'field1': { + 'value': 'Display Name 1' + }, + 'field2': { + 'value': 'Display Name 2', + 'flags': 1 + } }, 'authSchemes': { 'builtin': true, @@ -82,12 +92,30 @@ describe('OCA.External.Settings tests', function() { 'identifier': '\\OC\\InputsTestBackend', 'name': 'Inputs test backend', 'configuration': { - 'field_text': 'Text field', - 'field_password': '*Password field', - 'field_bool': '!Boolean field', - 'field_hidden': '#Hidden field', - 'field_text_optional': '&Text field optional', - 'field_password_optional': '&*Password field optional' + 'field_text': { + 'value': 'Text field' + }, + 'field_password': { + 'value': ',Password field', + 'type': 2 + }, + 'field_bool': { + 'value': 'Boolean field', + 'type': 1 + }, + 'field_hidden': { + 'value': 'Hidden field', + 'type': 3 + }, + 'field_text_optional': { + 'value': 'Text field optional', + 'flags': 1 + }, + 'field_password_optional': { + 'value': 'Password field optional', + 'flags': 1, + 'type': 2 + } }, 'authSchemes': { 'builtin': true, |