implement DRY principle (#6553)
This commit is contained in:
@@ -3712,38 +3712,6 @@ trait WebDav {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Old style chunking upload
|
||||
*
|
||||
* @Given user :user has uploaded the following :total chunks to :file with old chunking
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $total
|
||||
* @param string $file
|
||||
* @param TableNode $chunkDetails table of 2 columns, chunk number and chunk
|
||||
* content with following headings, e.g.
|
||||
* | number | content |
|
||||
* | 1 | first data |
|
||||
* | 2 | followed by second data |
|
||||
* Chunks may be numbered out-of-order if desired.
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userHasUploadedTheFollowingTotalChunksUsingOldChunking(
|
||||
string $user,
|
||||
string $total,
|
||||
string $file,
|
||||
TableNode $chunkDetails
|
||||
):void {
|
||||
$this->verifyTableNodeColumns($chunkDetails, ['number', 'content']);
|
||||
foreach ($chunkDetails->getHash() as $chunkDetail) {
|
||||
$chunkNumber = (int) $chunkDetail['number'];
|
||||
$chunkContent = $chunkDetail['content'];
|
||||
$this->userHasUploadedChunkedFile($user, $chunkNumber, (int) $total, $chunkContent, $file);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Old style chunking upload
|
||||
*
|
||||
@@ -3775,37 +3743,6 @@ trait WebDav {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Old style chunking upload
|
||||
*
|
||||
* @Given user :user has uploaded the following chunks to :file with old chunking
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $file
|
||||
* @param TableNode $chunkDetails table of 2 columns, chunk number and chunk
|
||||
* content with headings, e.g.
|
||||
* | number | content |
|
||||
* | 1 | first data |
|
||||
* | 2 | followed by second data |
|
||||
* Chunks may be numbered out-of-order if desired.
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userHasUploadedTheFollowingChunksUsingOldChunking(
|
||||
string $user,
|
||||
string $file,
|
||||
TableNode $chunkDetails
|
||||
):void {
|
||||
$total = \count($chunkDetails->getRows());
|
||||
$this->userHasUploadedTheFollowingTotalChunksUsingOldChunking(
|
||||
$user,
|
||||
(string) $total,
|
||||
$file,
|
||||
$chunkDetails
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Old style chunking upload
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user