summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-10-11 16:10:58 +0200
committerGitHub <noreply@github.com>2017-10-11 16:10:58 +0200
commit1a99e0dab4209717f953449dbdcd10aebdd1b568 (patch)
tree37be4ff34abb2671c6290f082cc581d9fe0c4d00 /tests
parent647b185c2b2dc393e3135adfe935e70253c9bef8 (diff)
parente393b3553eb5ad867b34f3fdc029a1887bcd3980 (diff)
downloadnextcloud-server-1a99e0dab4209717f953449dbdcd10aebdd1b568.tar.gz
nextcloud-server-1a99e0dab4209717f953449dbdcd10aebdd1b568.zip
Merge pull request #6602 from nextcloud/s3-multipart-upload
Add multipart upload for s3
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/ObjectStore/S3Test.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/lib/Files/ObjectStore/S3Test.php b/tests/lib/Files/ObjectStore/S3Test.php
index b93e9beebdc..14167656fb5 100644
--- a/tests/lib/Files/ObjectStore/S3Test.php
+++ b/tests/lib/Files/ObjectStore/S3Test.php
@@ -23,19 +23,32 @@ namespace Test\Files\ObjectStore;
use OC\Files\ObjectStore\S3;
+class MultiPartUploadS3 extends S3 {
+ public function multiPartUpload($urn, $stream) {
+ parent::multiPartUpload($urn, $stream);
+ }
+}
+
/**
* @group PRIMARY-s3
*/
class S3Test extends ObjectStoreTest {
- /**
- * @return \OCP\Files\ObjectStore\IObjectStore
- */
protected function getInstance() {
$config = \OC::$server->getConfig()->getSystemValue('objectstore');
if (!is_array($config) || $config['class'] !== 'OC\\Files\\ObjectStore\\S3') {
$this->markTestSkipped('objectstore not configured for s3');
}
- return new S3($config['arguments']);
+ return new MultiPartUploadS3($config['arguments']);
+ }
+
+ public function testMultiPartUploader() {
+ $s3 = $this->getInstance();
+
+ $s3->multiPartUpload('multiparttest', fopen(__FILE__, 'r'));
+
+ $result = $s3->readObject('multiparttest');
+
+ $this->assertEquals(file_get_contents(__FILE__), stream_get_contents($result));
}
}