From 7817f8578b397fbec4e279fb4069f30fe04b37e9 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Thu, 28 May 2020 20:50:02 +0200 Subject: Generalize integration test steps to download last share MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that the "last link share can be downloaded" step was kept as it tests the "url" property specific of link shares. Signed-off-by: Daniel Calviño Sánchez --- build/integration/features/bootstrap/Sharing.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'build/integration/features') diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index 0958ab5b64b..4ce2e12e29d 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -164,9 +164,23 @@ trait Sharing { } /** - * @Then /^last link share with password "([^"]*)" can be downloaded$/ + * @Then /^last share can be downloaded$/ */ - public function lastLinkShareWithPasswordCanBeDownloaded($password) { + public function lastShareCanBeDownloaded() { + if (count($this->lastShareData->data->element) > 0) { + $token = $this->lastShareData->data[0]->token; + } else { + $token = $this->lastShareData->data->token; + } + + $fullUrl = substr($this->baseUrl, 0, -4) . "index.php/s/" . $token . "/download"; + $this->checkDownload($fullUrl, null, 'text/plain'); + } + + /** + * @Then /^last share with password "([^"]*)" can be downloaded$/ + */ + public function lastShareWithPasswordCanBeDownloaded($password) { if (count($this->lastShareData->data->element) > 0) { $token = $this->lastShareData->data[0]->token; } else { -- cgit v1.2.3