diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-03-11 16:18:02 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-12 12:33:05 +0200 |
commit | 629bc1812ee9def6ed78418d3d203a827e95f1d2 (patch) | |
tree | 2f0266bd9721ce6fd5e854a96859f3752921afcd /build/integration/features/bootstrap/WebDav.php | |
parent | 72f5c539e887d2671641222d33848e28a936d771 (diff) | |
download | nextcloud-server-629bc1812ee9def6ed78418d3d203a827e95f1d2.tar.gz nextcloud-server-629bc1812ee9def6ed78418d3d203a827e95f1d2.zip |
Add intergration tests for new chunking
The same intergration tests as for the old endpoint.
But now using the new chunking.
We upload 3 chunks in different order and the result should be the same
in all three.
Diffstat (limited to 'build/integration/features/bootstrap/WebDav.php')
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 2ef5f252f11..0ca2a411c75 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -373,5 +373,37 @@ trait WebDav { $this->makeDavRequest($user, 'PUT', $file, ['OC-Chunked' => '1'], $data); } + /** + * @Given user :user creates a new chunking upload with id :id + */ + public function userCreatesANewChunkingUploadWithId($user, $id) + { + $destination = '/uploads/'.$user.'/'.$id; + $this->makeDavRequest($user, 'MKCOL', $destination, []); + } + + /** + * @Given user :user uploads new chunk file :num with :data to id :id + */ + public function userUploadsNewChunkFileOfWithToId($user, $num, $data, $id) + { + $data = \GuzzleHttp\Stream\Stream::factory($data); + $destination = '/uploads/'.$user.'/'.$id.'/'.$num; + $this->makeDavRequest($user, 'PUT', $destination, [], $data); + } + + /** + * @Given user :user moves new chunk file with id :id to :dest + */ + public function userMovesNewChunkFileWithIdToMychunkedfile($user, $id, $dest) + { + $source = '/uploads/'.$user.'/'.$id.'/.file'; + $destination = substr($this->baseUrl, 0, -4) . $this->davPath . '/files/'.$user.$dest; + $this->makeDavRequest($user, 'MOVE', $source, [ + 'Destination' => $destination + ]); + } + + } |