aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Mount/RootMountProviderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Files/Mount/RootMountProviderTest.php')
-rw-r--r--tests/lib/Files/Mount/RootMountProviderTest.php76
1 files changed, 31 insertions, 45 deletions
diff --git a/tests/lib/Files/Mount/RootMountProviderTest.php b/tests/lib/Files/Mount/RootMountProviderTest.php
index e5eaabf93be..bf29bfa070a 100644
--- a/tests/lib/Files/Mount/RootMountProviderTest.php
+++ b/tests/lib/Files/Mount/RootMountProviderTest.php
@@ -2,34 +2,20 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2022 Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Files\Mount;
use OC\Files\Mount\RootMountProvider;
use OC\Files\ObjectStore\ObjectStoreStorage;
+use OC\Files\ObjectStore\PrimaryObjectStoreConfig;
use OC\Files\ObjectStore\S3;
use OC\Files\Storage\LocalRootStorage;
use OC\Files\Storage\StorageFactory;
+use OCP\App\IAppManager;
use OCP\IConfig;
-use Psr\Log\LoggerInterface;
use Test\TestCase;
/**
@@ -55,11 +41,11 @@ class RootMountProviderTest extends TestCase {
private function getProvider(array $systemConfig): RootMountProvider {
$config = $this->getConfig($systemConfig);
- $provider = new RootMountProvider($config, $this->createMock(LoggerInterface::class));
- return $provider;
+ $objectStoreConfig = new PrimaryObjectStoreConfig($config, $this->createMock(IAppManager::class));
+ return new RootMountProvider($objectStoreConfig, $config);
}
- public function testLocal() {
+ public function testLocal(): void {
$provider = $this->getProvider([
'datadirectory' => '/data',
]);
@@ -73,20 +59,20 @@ class RootMountProviderTest extends TestCase {
$this->assertEquals('/data/', $storage->getSourcePath(''));
}
- public function testObjectStore() {
+ public function testObjectStore(): void {
$provider = $this->getProvider([
'objectstore' => [
- "class" => "OC\Files\ObjectStore\S3",
- "arguments" => [
- "bucket" => "nextcloud",
- "autocreate" => true,
- "key" => "minio",
- "secret" => "minio123",
- "hostname" => "localhost",
- "port" => 9000,
- "use_ssl" => false,
- "use_path_style" => true,
- "uploadPartSize" => 52428800,
+ 'class' => "OC\Files\ObjectStore\S3",
+ 'arguments' => [
+ 'bucket' => 'nextcloud',
+ 'autocreate' => true,
+ 'key' => 'minio',
+ 'secret' => 'minio123',
+ 'hostname' => 'localhost',
+ 'port' => 9000,
+ 'use_ssl' => false,
+ 'use_path_style' => true,
+ 'uploadPartSize' => 52428800,
],
],
]);
@@ -106,20 +92,20 @@ class RootMountProviderTest extends TestCase {
$this->assertEquals('nextcloud', $objectStore->getBucket());
}
- public function testObjectStoreMultiBucket() {
+ public function testObjectStoreMultiBucket(): void {
$provider = $this->getProvider([
'objectstore_multibucket' => [
- "class" => "OC\Files\ObjectStore\S3",
- "arguments" => [
- "bucket" => "nextcloud",
- "autocreate" => true,
- "key" => "minio",
- "secret" => "minio123",
- "hostname" => "localhost",
- "port" => 9000,
- "use_ssl" => false,
- "use_path_style" => true,
- "uploadPartSize" => 52428800,
+ 'class' => "OC\Files\ObjectStore\S3",
+ 'arguments' => [
+ 'bucket' => 'nextcloud',
+ 'autocreate' => true,
+ 'key' => 'minio',
+ 'secret' => 'minio123',
+ 'hostname' => 'localhost',
+ 'port' => 9000,
+ 'use_ssl' => false,
+ 'use_path_style' => true,
+ 'uploadPartSize' => 52428800,
],
],
]);