summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-03-13 12:49:11 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-13 12:49:11 +0100
commit34c8b1ac7732b4502beebea0dfeeaa8bac225550 (patch)
tree6fbcb5c17781157bf14afe141b9738814db393c5 /apps/files_external/tests
parent680ec056dc8c4fb84b8300967bcc12db2a57f225 (diff)
downloadnextcloud-server-34c8b1ac7732b4502beebea0dfeeaa8bac225550.tar.gz
nextcloud-server-34c8b1ac7732b4502beebea0dfeeaa8bac225550.zip
Mount options for ext storage are now passed around
The mount options are now passed to the UI and stored in a hidden field. The ext storage controllers and services also know how to load/save them from the legacy config.
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r--apps/files_external/tests/controller/storagescontrollertest.php8
-rw-r--r--apps/files_external/tests/controller/userstoragescontrollertest.php2
-rw-r--r--apps/files_external/tests/service/globalstoragesservicetest.php6
-rw-r--r--apps/files_external/tests/service/storagesservicetest.php3
-rw-r--r--apps/files_external/tests/service/userstoragesservicetest.php4
-rw-r--r--apps/files_external/tests/storageconfigtest.php2
6 files changed, 25 insertions, 0 deletions
diff --git a/apps/files_external/tests/controller/storagescontrollertest.php b/apps/files_external/tests/controller/storagescontrollertest.php
index fefe2928d76..853b4a86f03 100644
--- a/apps/files_external/tests/controller/storagescontrollertest.php
+++ b/apps/files_external/tests/controller/storagescontrollertest.php
@@ -62,6 +62,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
array(),
[],
[],
+ [],
null
);
@@ -85,6 +86,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
array(),
[],
[],
+ [],
null
);
@@ -116,6 +118,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
array(),
[],
[],
+ [],
null
);
@@ -128,6 +131,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
array(),
[],
[],
+ [],
null
);
@@ -146,6 +150,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
array(),
[],
[],
+ [],
null
);
@@ -158,6 +163,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
array(),
[],
[],
+ [],
null
);
@@ -176,6 +182,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
array(),
[],
[],
+ [],
null
);
@@ -204,6 +211,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$storageConfig->setMountPoint('test');
$storageConfig->setBackendClass('\OC\Files\Storage\SMB');
$storageConfig->setBackendOptions(['user' => 'test', 'password', 'password123']);
+ $storageConfig->setMountOptions(['priority' => false]);
$this->service->expects($this->once())
->method('getStorage')
diff --git a/apps/files_external/tests/controller/userstoragescontrollertest.php b/apps/files_external/tests/controller/userstoragescontrollertest.php
index 9d6fbb15e23..0ba413f6959 100644
--- a/apps/files_external/tests/controller/userstoragescontrollertest.php
+++ b/apps/files_external/tests/controller/userstoragescontrollertest.php
@@ -91,6 +91,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
array(),
[],
[],
+ [],
null
);
@@ -103,6 +104,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
array(),
[],
[],
+ [],
null
);
diff --git a/apps/files_external/tests/service/globalstoragesservicetest.php b/apps/files_external/tests/service/globalstoragesservicetest.php
index 6286865bf43..f5cdcfa3907 100644
--- a/apps/files_external/tests/service/globalstoragesservicetest.php
+++ b/apps/files_external/tests/service/globalstoragesservicetest.php
@@ -50,6 +50,9 @@ class GlobalStoragesServiceTest extends StoragesServiceTest {
'applicableUsers' => [],
'applicableGroups' => [],
'priority' => 15,
+ 'mountOptions' => [
+ 'preview' => false,
+ ]
]);
}
@@ -638,6 +641,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest {
$this->assertEquals(1, $mountPointOptions['id']);
$this->assertEquals('\OC\Files\Storage\SMB', $mountPointOptions['class']);
$this->assertEquals(15, $mountPointOptions['priority']);
+ $this->assertEquals(false, $mountPointOptions['mountOptions']['preview']);
$backendOptions = $mountPointOptions['options'];
$this->assertEquals('value1', $backendOptions['option1']);
@@ -677,6 +681,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest {
$this->assertEquals(1, $mountPointOptions['id']);
$this->assertEquals('\OC\Files\Storage\SMB', $mountPointOptions['class']);
$this->assertEquals(15, $mountPointOptions['priority']);
+ $this->assertEquals(false, $mountPointOptions['mountOptions']['preview']);
$backendOptions = $mountPointOptions['options'];
$this->assertEquals('value1', $backendOptions['option1']);
@@ -693,6 +698,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest {
$this->assertEquals(1, $mountPointOptions['id']);
$this->assertEquals('\OC\Files\Storage\SMB', $mountPointOptions['class']);
$this->assertEquals(15, $mountPointOptions['priority']);
+ $this->assertEquals(false, $mountPointOptions['mountOptions']['preview']);
$backendOptions = $mountPointOptions['options'];
$this->assertEquals('value1', $backendOptions['option1']);
diff --git a/apps/files_external/tests/service/storagesservicetest.php b/apps/files_external/tests/service/storagesservicetest.php
index 1e338b3948d..445e86d4117 100644
--- a/apps/files_external/tests/service/storagesservicetest.php
+++ b/apps/files_external/tests/service/storagesservicetest.php
@@ -96,6 +96,9 @@ abstract class StoragesServiceTest extends \Test\TestCase {
if (isset($data['priority'])) {
$storage->setPriority($data['priority']);
}
+ if (isset($data['mountOptions'])) {
+ $storage->setMountOptions($data['mountOptions']);
+ }
return $storage;
}
diff --git a/apps/files_external/tests/service/userstoragesservicetest.php b/apps/files_external/tests/service/userstoragesservicetest.php
index 64d59dc7d03..77b3842b318 100644
--- a/apps/files_external/tests/service/userstoragesservicetest.php
+++ b/apps/files_external/tests/service/userstoragesservicetest.php
@@ -61,6 +61,9 @@ class UserStoragesServiceTest extends StoragesServiceTest {
'option2' => 'value2',
'password' => 'testPassword',
],
+ 'mountOptions' => [
+ 'preview' => false,
+ ]
]);
}
@@ -190,6 +193,7 @@ class UserStoragesServiceTest extends StoragesServiceTest {
$mountPointOptions = current($mountPointData);
$this->assertEquals(1, $mountPointOptions['id']);
$this->assertEquals('\OC\Files\Storage\SMB', $mountPointOptions['class']);
+ $this->assertEquals(false, $mountPointOptions['mountOptions']['preview']);
$backendOptions = $mountPointOptions['options'];
$this->assertEquals('value1', $backendOptions['option1']);
diff --git a/apps/files_external/tests/storageconfigtest.php b/apps/files_external/tests/storageconfigtest.php
index 473dc20b387..ec79b1bf306 100644
--- a/apps/files_external/tests/storageconfigtest.php
+++ b/apps/files_external/tests/storageconfigtest.php
@@ -34,6 +34,7 @@ class StorageConfigTest extends \Test\TestCase {
$storageConfig->setPriority(128);
$storageConfig->setApplicableUsers(['user1', 'user2']);
$storageConfig->setApplicableGroups(['group1', 'group2']);
+ $storageConfig->setMountOptions(['preview' => false]);
$json = $storageConfig->jsonSerialize();
@@ -45,6 +46,7 @@ class StorageConfigTest extends \Test\TestCase {
$this->assertEquals(128, $json['priority']);
$this->assertEquals(['user1', 'user2'], $json['applicableUsers']);
$this->assertEquals(['group1', 'group2'], $json['applicableGroups']);
+ $this->assertEquals(['preview' => false], $json['mountOptions']);
}
}