summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-06 20:10:25 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-08-06 22:31:39 +0200
commit45428e49482b8c1916859fbe80564670fa51f8ff (patch)
tree4f30448487a473296866b83051a66de262571077 /tests/lib
parent4fdd38c7378415c552859dc4c0d2dda709f699ec (diff)
downloadnextcloud-server-45428e49482b8c1916859fbe80564670fa51f8ff.tar.gz
nextcloud-server-45428e49482b8c1916859fbe80564670fa51f8ff.zip
Add config option to enable multibucket preview distribution
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php35
1 files changed, 21 insertions, 14 deletions
diff --git a/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php b/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
index 2da07393f40..400808d7cd5 100644
--- a/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
+++ b/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
@@ -71,22 +71,29 @@ class ObjectStorePreviewCacheMountProviderTest extends \Test\TestCase {
}
public function testMultibucketObjectStorage() {
+ $objectstoreConfig = [
+ 'class' => S3::class,
+ 'arguments' => [
+ 'bucket' => 'abc',
+ 'num_buckets' => 64,
+ 'key' => 'KEY',
+ 'secret' => 'SECRET',
+ 'hostname' => 'IP',
+ 'port' => 'PORT',
+ 'use_ssl' => false,
+ 'use_path_style' => true,
+ ],
+ ];
$this->config->expects($this->any())
->method('getSystemValue')
- ->with('objectstore_multibucket')
- ->willReturn([
- 'class' => S3::class,
- 'arguments' => [
- 'bucket' => 'abc',
- 'num_buckets' => 64,
- 'key' => 'KEY',
- 'secret' => 'SECRET',
- 'hostname' => 'IP',
- 'port' => 'PORT',
- 'use_ssl' => false,
- 'use_path_style' => true,
- ],
- ]);
+ ->willReturnCallback(function ($config) use ($objectstoreConfig) {
+ if ($config === 'objectstore_multibucket') {
+ return $objectstoreConfig;
+ } elseif ($config === 'objectstore.multibucket.preview-distribution') {
+ return true;
+ }
+ return null;
+ });
$this->config->expects($this->once())
->method('getSystemValueString')
->with('instanceid')