diff options
Diffstat (limited to 'tests/lib/Files/Mount/RootMountProviderTest.php')
-rw-r--r-- | tests/lib/Files/Mount/RootMountProviderTest.php | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/tests/lib/Files/Mount/RootMountProviderTest.php b/tests/lib/Files/Mount/RootMountProviderTest.php index 4a5048d2863..bf29bfa070a 100644 --- a/tests/lib/Files/Mount/RootMountProviderTest.php +++ b/tests/lib/Files/Mount/RootMountProviderTest.php @@ -10,11 +10,12 @@ 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; /** @@ -40,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', ]); @@ -58,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, ], ], ]); @@ -91,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, ], ], ]); |