2012-05-16 21:51:45 -04:00
|
|
|
<?php
|
2025-05-17 05:46:26 -04:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2012-05-16 21:51:45 -04:00
|
|
|
/**
|
2024-06-06 03:55:47 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2012-10-11 15:12:52 -04:00
|
|
|
*/
|
2016-04-13 18:18:07 -04:00
|
|
|
namespace OCA\Files_External\Tests\Storage;
|
|
|
|
|
|
2019-11-22 14:52:10 -05:00
|
|
|
use OCA\Files_External\Lib\Storage\AmazonS3;
|
2012-09-22 08:51:15 -04:00
|
|
|
|
2015-11-19 10:42:29 -05:00
|
|
|
/**
|
2016-05-24 10:37:06 -04:00
|
|
|
* Class Amazons3Test
|
2015-11-19 10:42:29 -05:00
|
|
|
*
|
|
|
|
|
* @group DB
|
2025-06-06 08:06:57 -04:00
|
|
|
* @group S3
|
2015-11-19 10:42:29 -05:00
|
|
|
*
|
2016-04-13 18:18:07 -04:00
|
|
|
* @package OCA\Files_External\Tests\Storage
|
2015-11-19 10:42:29 -05:00
|
|
|
*/
|
2016-05-24 10:37:06 -04:00
|
|
|
class Amazons3Test extends \Test\Files\Storage\Storage {
|
2025-06-07 10:35:46 -04:00
|
|
|
protected $config;
|
2021-10-14 11:28:32 -04:00
|
|
|
/** @var AmazonS3 */
|
|
|
|
|
protected $instance;
|
2012-05-16 21:51:45 -04:00
|
|
|
|
2019-11-21 10:40:38 -05:00
|
|
|
protected function setUp(): void {
|
2014-11-10 16:28:12 -05:00
|
|
|
parent::setUp();
|
|
|
|
|
|
2015-09-15 11:40:52 -04:00
|
|
|
$this->config = include('files_external/tests/config.amazons3.php');
|
2025-06-07 10:35:46 -04:00
|
|
|
if (!is_array($this->config) || !$this->config['run']) {
|
2012-10-11 15:12:52 -04:00
|
|
|
$this->markTestSkipped('AmazonS3 backend not configured');
|
2012-05-16 21:51:45 -04:00
|
|
|
}
|
2016-04-13 18:18:07 -04:00
|
|
|
$this->instance = new AmazonS3($this->config);
|
2012-10-11 15:12:52 -04:00
|
|
|
}
|
2012-05-16 21:51:45 -04:00
|
|
|
|
2019-11-21 10:40:38 -05:00
|
|
|
protected function tearDown(): void {
|
2012-10-11 15:12:52 -04:00
|
|
|
if ($this->instance) {
|
2014-08-01 08:20:00 -04:00
|
|
|
$this->instance->rmdir('');
|
2012-05-16 21:51:45 -04:00
|
|
|
}
|
2014-11-10 16:28:12 -05:00
|
|
|
|
|
|
|
|
parent::tearDown();
|
2012-05-16 21:51:45 -04:00
|
|
|
}
|
2014-08-01 09:06:05 -04:00
|
|
|
|
|
|
|
|
public function testStat(): void {
|
|
|
|
|
$this->markTestSkipped('S3 doesn\'t update the parents folder mtime');
|
|
|
|
|
}
|
2012-05-16 21:51:45 -04:00
|
|
|
}
|