refactored acceptance test code to store response data related to public shares on single store (#6930)
This commit is contained in:
@@ -51,7 +51,7 @@ class PublicWebDavContext implements Context {
|
||||
// accessing it as a public link using the "new" public webDAV API
|
||||
// the client needs to provide the public link share token followed
|
||||
// by just the name of the file - not the full path.
|
||||
$fullPath = $this->featureContext->getLastPublicSharePath();
|
||||
$fullPath = (string) $this->featureContext->getLastCreatedPublicShare()->path;
|
||||
$fullPathParts = \explode("/", $fullPath);
|
||||
$path = \end($fullPathParts);
|
||||
} else {
|
||||
@@ -76,7 +76,7 @@ class PublicWebDavContext implements Context {
|
||||
*/
|
||||
public function downloadPublicFileWithRangeAndPassword(string $range, string $password, string $publicWebDAVAPIVersion):void {
|
||||
if ($publicWebDAVAPIVersion === "new") {
|
||||
$path = $this->featureContext->getLastPublicShareData()->data->file_target;
|
||||
$path = (string) $this->featureContext->getLastCreatedPublicShare()->file_target;
|
||||
} else {
|
||||
$path = "";
|
||||
}
|
||||
@@ -124,7 +124,7 @@ class PublicWebDavContext implements Context {
|
||||
if ($publicWebDAVAPIVersion === "old") {
|
||||
return;
|
||||
}
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$davPath = WebDavHelper::getDavPath(
|
||||
$token,
|
||||
0,
|
||||
@@ -178,7 +178,7 @@ class PublicWebDavContext implements Context {
|
||||
if ($publicWebDAVAPIVersion === "old") {
|
||||
return;
|
||||
}
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$davPath = WebDavHelper::getDavPath(
|
||||
$token,
|
||||
0,
|
||||
@@ -296,7 +296,7 @@ class PublicWebDavContext implements Context {
|
||||
):void {
|
||||
$path = \ltrim($path, "/");
|
||||
$password = $this->featureContext->getActualPassword($password);
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$davPath = WebDavHelper::getDavPath(
|
||||
$token,
|
||||
0,
|
||||
@@ -401,7 +401,7 @@ class PublicWebDavContext implements Context {
|
||||
* @return void
|
||||
*/
|
||||
public function thePublicCopiesFileUsingTheWebDAVApi(string $source, string $destination, string $publicWebDAVAPIVersion):void {
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$davPath = WebDavHelper::getDavPath(
|
||||
$token,
|
||||
0,
|
||||
@@ -1086,7 +1086,7 @@ class PublicWebDavContext implements Context {
|
||||
if ($publicWebDAVAPIVersion === "old") {
|
||||
return;
|
||||
}
|
||||
$filename = (string)$this->featureContext->getLastPublicShareData()->data[0]->file_target;
|
||||
$filename = (string)$this->featureContext->getLastCreatedPublicShare()->file_target;
|
||||
|
||||
$this->publicUploadContent(
|
||||
$filename,
|
||||
@@ -1251,7 +1251,7 @@ class PublicWebDavContext implements Context {
|
||||
if ($publicWebDAVAPIVersion === "old") {
|
||||
return;
|
||||
} elseif ($publicWebDAVAPIVersion === "new") {
|
||||
$path = $this->featureContext->getLastPublicSharePath();
|
||||
$path = (string) $this->featureContext->getLastCreatedPublicShare()->path;
|
||||
} else {
|
||||
$path = "";
|
||||
}
|
||||
@@ -1329,7 +1329,7 @@ class PublicWebDavContext implements Context {
|
||||
string $destination,
|
||||
string $password
|
||||
):void {
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$davPath = WebDavHelper::getDavPath(
|
||||
$token,
|
||||
0,
|
||||
@@ -1421,7 +1421,7 @@ class PublicWebDavContext implements Context {
|
||||
string $fileName,
|
||||
string $mtime
|
||||
):void {
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$baseUrl = $this->featureContext->getBaseUrl();
|
||||
$mtime = \explode(" ", $mtime);
|
||||
\array_pop($mtime);
|
||||
@@ -1450,7 +1450,7 @@ class PublicWebDavContext implements Context {
|
||||
string $fileName,
|
||||
string $mtime
|
||||
):void {
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$baseUrl = $this->featureContext->getBaseUrl();
|
||||
Assert::assertNotEquals(
|
||||
$mtime,
|
||||
@@ -1487,7 +1487,7 @@ class PublicWebDavContext implements Context {
|
||||
return;
|
||||
}
|
||||
$password = $this->featureContext->getActualPassword($password);
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$davPath = WebDavHelper::getDavPath(
|
||||
$token,
|
||||
0,
|
||||
@@ -1593,7 +1593,7 @@ class PublicWebDavContext implements Context {
|
||||
} else {
|
||||
$body = null;
|
||||
}
|
||||
$token = $this->featureContext->getLastPublicShareToken();
|
||||
$token = $this->featureContext->getLastCreatedPublicShareToken();
|
||||
$davPath = WebDavHelper::getDavPath(
|
||||
null,
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user