Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-09-21 15:47:14 +0300
committerRobin Appelman <robin@icewind.nl>2017-10-09 16:29:44 +0300
commit239f561ab2210e4c3b55075aa7ed9df94139d4d2 (patch)
treebe0623ea17fc63c57b456667d6fdd7eca5a3dcf4 /tests
parent6fee4232ee540bda84fcb29ef7e7ae420e85b946 (diff)
Add tests for multipart upload
Signed-off-by: Robin Appelman <robin@icewind.nl>
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));
}
}