diff options
Diffstat (limited to 'apps/files_external/tests/Storage')
10 files changed, 40 insertions, 21 deletions
diff --git a/apps/files_external/tests/Storage/Amazons3MultiPartTest.php b/apps/files_external/tests/Storage/Amazons3MultiPartTest.php index 1ac18406d24..aa3925899f3 100644 --- a/apps/files_external/tests/Storage/Amazons3MultiPartTest.php +++ b/apps/files_external/tests/Storage/Amazons3MultiPartTest.php @@ -1,9 +1,11 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\files_external\tests\Storage; +namespace OCA\Files_External\Tests\Storage; use OCA\Files_External\Lib\Storage\AmazonS3; @@ -11,6 +13,7 @@ use OCA\Files_External\Lib\Storage\AmazonS3; * Class Amazons3Test * * @group DB + * @group S3 * * @package OCA\Files_External\Tests\Storage */ @@ -23,7 +26,7 @@ class Amazons3MultiPartTest extends \Test\Files\Storage\Storage { parent::setUp(); $this->config = include('files_external/tests/config.amazons3.php'); - if (! is_array($this->config) or ! $this->config['run']) { + if (!is_array($this->config) || !$this->config['run']) { $this->markTestSkipped('AmazonS3 backend not configured'); } $this->instance = new AmazonS3($this->config + [ @@ -43,8 +46,4 @@ class Amazons3MultiPartTest extends \Test\Files\Storage\Storage { public function testStat(): void { $this->markTestSkipped('S3 doesn\'t update the parents folder mtime'); } - - public function testHashInFileName(): void { - $this->markTestSkipped('Localstack has a bug with hashes in filename'); - } } diff --git a/apps/files_external/tests/Storage/Amazons3Test.php b/apps/files_external/tests/Storage/Amazons3Test.php index fd7fd9225c9..d02dec0230c 100644 --- a/apps/files_external/tests/Storage/Amazons3Test.php +++ b/apps/files_external/tests/Storage/Amazons3Test.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -12,11 +14,12 @@ use OCA\Files_External\Lib\Storage\AmazonS3; * Class Amazons3Test * * @group DB + * @group S3 * * @package OCA\Files_External\Tests\Storage */ class Amazons3Test extends \Test\Files\Storage\Storage { - private $config; + protected $config; /** @var AmazonS3 */ protected $instance; @@ -24,7 +27,7 @@ class Amazons3Test extends \Test\Files\Storage\Storage { parent::setUp(); $this->config = include('files_external/tests/config.amazons3.php'); - if (! is_array($this->config) or ! $this->config['run']) { + if (!is_array($this->config) || !$this->config['run']) { $this->markTestSkipped('AmazonS3 backend not configured'); } $this->instance = new AmazonS3($this->config); @@ -41,8 +44,4 @@ class Amazons3Test extends \Test\Files\Storage\Storage { public function testStat(): void { $this->markTestSkipped('S3 doesn\'t update the parents folder mtime'); } - - public function testHashInFileName(): void { - $this->markTestSkipped('Localstack has a bug with hashes in filename'); - } } diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php index 81b92e0fae9..095a5236049 100644 --- a/apps/files_external/tests/Storage/FtpTest.php +++ b/apps/files_external/tests/Storage/FtpTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/files_external/tests/Storage/OwncloudTest.php b/apps/files_external/tests/Storage/OwncloudTest.php index 28041a665f8..ab6cd443dba 100644 --- a/apps/files_external/tests/Storage/OwncloudTest.php +++ b/apps/files_external/tests/Storage/OwncloudTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/files_external/tests/Storage/SFTP_KeyTest.php b/apps/files_external/tests/Storage/SFTP_KeyTest.php index 9be3cb7d3e8..17e2087f91b 100644 --- a/apps/files_external/tests/Storage/SFTP_KeyTest.php +++ b/apps/files_external/tests/Storage/SFTP_KeyTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -40,7 +42,7 @@ class SFTP_KeyTest extends \Test\Files\Storage\Storage { parent::tearDown(); } - + public function testInvalidAddressShouldThrowException(): void { $this->expectException(\InvalidArgumentException::class); @@ -52,24 +54,24 @@ class SFTP_KeyTest extends \Test\Files\Storage\Storage { $this->assertTrue($this->instance->assertHostAddressValid('localhost')); } - + public function testNegativePortNumberShouldThrowException(): void { $this->expectException(\InvalidArgumentException::class); $this->instance->assertPortNumberValid('-1'); } - + public function testNonNumericalPortNumberShouldThrowException(): void { $this->expectException(\InvalidArgumentException::class); $this->instance->assertPortNumberValid('a'); } - + public function testHighPortNumberShouldThrowException(): void { $this->expectException(\InvalidArgumentException::class); - + $this->instance->assertPortNumberValid('65536'); } diff --git a/apps/files_external/tests/Storage/SftpTest.php b/apps/files_external/tests/Storage/SftpTest.php index cc29486f426..ebfc8ab3c1f 100644 --- a/apps/files_external/tests/Storage/SftpTest.php +++ b/apps/files_external/tests/Storage/SftpTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -44,15 +46,13 @@ class SftpTest extends \Test\Files\Storage\Storage { parent::tearDown(); } - /** - * @dataProvider configProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('configProvider')] public function testStorageId($config, $expectedStorageId): void { $instance = new SFTP($config); $this->assertEquals($expectedStorageId, $instance->getId()); } - public function configProvider() { + public static function configProvider(): array { return [ [ // no root path diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php index 51737d05dc6..afcb5c1034f 100644 --- a/apps/files_external/tests/Storage/SmbTest.php +++ b/apps/files_external/tests/Storage/SmbTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/files_external/tests/Storage/SwiftTest.php b/apps/files_external/tests/Storage/SwiftTest.php index c21c8c6f506..17037e76ee3 100644 --- a/apps/files_external/tests/Storage/SwiftTest.php +++ b/apps/files_external/tests/Storage/SwiftTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/files_external/tests/Storage/VersionedAmazonS3Test.php b/apps/files_external/tests/Storage/VersionedAmazonS3Test.php index 4d9d1e32067..9d413620292 100644 --- a/apps/files_external/tests/Storage/VersionedAmazonS3Test.php +++ b/apps/files_external/tests/Storage/VersionedAmazonS3Test.php @@ -10,6 +10,7 @@ namespace OCA\Files_External\Tests\Storage; /** * @group DB + * @group S3 */ class VersionedAmazonS3Test extends Amazons3Test { protected function setUp(): void { @@ -25,4 +26,12 @@ class VersionedAmazonS3Test extends Amazons3Test { $this->markTestSkipped("s3 backend doesn't seem to support versioning"); } } + + public function testCopyOverWriteDirectory(): void { + if (isset($this->config['minio'])) { + $this->markTestSkipped('MinIO has a bug with batch deletion on versioned storages, see https://github.com/minio/minio/issues/21366'); + } + + parent::testCopyOverWriteDirectory(); + } } diff --git a/apps/files_external/tests/Storage/WebdavTest.php b/apps/files_external/tests/Storage/WebdavTest.php index f1d3415e91e..a8de178effd 100644 --- a/apps/files_external/tests/Storage/WebdavTest.php +++ b/apps/files_external/tests/Storage/WebdavTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. |