Amazons3MultiPartTest.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2023 Robin Appelman <robin@icewind.nl>
  4. *
  5. * @author Maxence Lange <maxence@artificial-owl.com>
  6. * @author Robin Appelman <robin@icewind.nl>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCA\files_external\tests\Storage;
  25. use OCA\Files_External\Lib\Storage\AmazonS3;
  26. /**
  27. * Class Amazons3Test
  28. *
  29. * @group DB
  30. *
  31. * @package OCA\Files_External\Tests\Storage
  32. */
  33. class Amazons3MultiPartTest extends \Test\Files\Storage\Storage {
  34. private $config;
  35. /** @var AmazonS3 */
  36. protected $instance;
  37. protected function setUp(): void {
  38. parent::setUp();
  39. $this->config = include('files_external/tests/config.amazons3.php');
  40. if (! is_array($this->config) or ! $this->config['run']) {
  41. $this->markTestSkipped('AmazonS3 backend not configured');
  42. }
  43. $this->instance = new AmazonS3($this->config + [
  44. 'putSizeLimit' => 1,
  45. 'copySizeLimit' => 1,
  46. ]);
  47. }
  48. protected function tearDown(): void {
  49. if ($this->instance) {
  50. $this->instance->rmdir('');
  51. }
  52. parent::tearDown();
  53. }
  54. public function testStat() {
  55. $this->markTestSkipped('S3 doesn\'t update the parents folder mtime');
  56. }
  57. public function testHashInFileName() {
  58. $this->markTestSkipped('Localstack has a bug with hashes in filename');
  59. }
  60. }