summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-02-08 14:31:23 +0100
committerGitHub <noreply@github.com>2018-02-08 14:31:23 +0100
commit197c97e242e9238057662c847685b3d2534f7c5b (patch)
tree0063dc393a413dc19cb88d277f8dafc78916a18e /tests
parente2cb6a3b3c784d2882bb1e690560a1de0d0f1f48 (diff)
parent7ab3a7e2c34658668fc7f4cf4511d963623edcf8 (diff)
downloadnextcloud-server-197c97e242e9238057662c847685b3d2534f7c5b.tar.gz
nextcloud-server-197c97e242e9238057662c847685b3d2534f7c5b.zip
Merge pull request #8102 from nextcloud/s3-uploader-13
[13] Use S3Client::upload instead of splitting single/multipart upload ourselves
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/ObjectStore/S3Test.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/lib/Files/ObjectStore/S3Test.php b/tests/lib/Files/ObjectStore/S3Test.php
index 14167656fb5..a54ade8fd08 100644
--- a/tests/lib/Files/ObjectStore/S3Test.php
+++ b/tests/lib/Files/ObjectStore/S3Test.php
@@ -24,8 +24,10 @@ namespace Test\Files\ObjectStore;
use OC\Files\ObjectStore\S3;
class MultiPartUploadS3 extends S3 {
- public function multiPartUpload($urn, $stream) {
- parent::multiPartUpload($urn, $stream);
+ function writeObject($urn, $stream) {
+ $this->getConnection()->upload($this->bucket, $urn, $stream, 'private', [
+ 'mup_threshold' => 1
+ ]);
}
}
@@ -39,13 +41,18 @@ class S3Test extends ObjectStoreTest {
$this->markTestSkipped('objectstore not configured for s3');
}
- return new MultiPartUploadS3($config['arguments']);
+ return new S3($config['arguments']);
}
public function testMultiPartUploader() {
- $s3 = $this->getInstance();
+ $config = \OC::$server->getConfig()->getSystemValue('objectstore');
+ if (!is_array($config) || $config['class'] !== 'OC\\Files\\ObjectStore\\S3') {
+ $this->markTestSkipped('objectstore not configured for s3');
+ }
+
+ $s3 = new MultiPartUploadS3($config['arguments']);
- $s3->multiPartUpload('multiparttest', fopen(__FILE__, 'r'));
+ $s3->writeObject('multiparttest', fopen(__FILE__, 'r'));
$result = $s3->readObject('multiparttest');