diff options
author | Bernd Rederlechner <Bernd.Rederlechner@t-systems.com> | 2021-07-08 15:19:39 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-08-20 17:02:25 +0200 |
commit | 3866f388b1c7a476be1ae5fd1cd044e5a112feec (patch) | |
tree | 1f01f6d5e8566a58a39ad16ee5e9063a65e36d0e /tests/lib/Files/ObjectStore/ObjectStoreTest.php | |
parent | 98e2dce3a441d0e1ff6217959c75603ce222441a (diff) | |
download | nextcloud-server-3866f388b1c7a476be1ae5fd1cd044e5a112feec.tar.gz nextcloud-server-3866f388b1c7a476be1ae5fd1cd044e5a112feec.zip |
Refactor writeObject to only use MultipartUpload when required
Signed-off-by: Bernd Rederlechner <Bernd.Rederlechner@t-systems.com>
Co-authored-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests/lib/Files/ObjectStore/ObjectStoreTest.php')
-rw-r--r-- | tests/lib/Files/ObjectStore/ObjectStoreTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/Files/ObjectStore/ObjectStoreTest.php b/tests/lib/Files/ObjectStore/ObjectStoreTest.php index 4ec44eb410d..a245f0ae366 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreTest.php @@ -26,11 +26,27 @@ use Test\TestCase; abstract class ObjectStoreTest extends TestCase { + /** @var string[] */ + private $cleanup = []; + /** * @return \OCP\Files\ObjectStore\IObjectStore */ abstract protected function getInstance(); + protected function cleanupAfter(string $urn) { + $this->cleanup[] = $urn; + } + + public function tearDown(): void { + parent::tearDown(); + + $instance = $this->getInstance(); + foreach ($this->cleanup as $urn) { + $instance->deleteObject($urn); + } + } + protected function stringToStream($data) { $stream = fopen('php://temp', 'w+'); fwrite($stream, $data); @@ -110,6 +126,9 @@ abstract class ObjectStoreTest extends TestCase { } public function testCopy() { + $this->cleanupAfter('source'); + $this->cleanupAfter('target'); + $stream = $this->stringToStream('foobar'); $instance = $this->getInstance(); |