diff options
author | Robin Appelman <robin@icewind.nl> | 2017-09-21 14:47:14 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-09-21 14:47:34 +0200 |
commit | 385d6f098c1466608d1a87312b208bbf22abeb0d (patch) | |
tree | a708ad2ba4ecd267b2078dc4822dbfc71d31a777 /tests/lib/Files/ObjectStore | |
parent | 4ae46d887626630b675d132db3587d06de08d35d (diff) | |
download | nextcloud-server-385d6f098c1466608d1a87312b208bbf22abeb0d.tar.gz nextcloud-server-385d6f098c1466608d1a87312b208bbf22abeb0d.zip |
Add tests for multipart upload
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/Files/ObjectStore')
-rw-r--r-- | tests/lib/Files/ObjectStore/S3Test.php | 21 |
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)); } } |