diff --git a/tests/acceptance/TestHelpers/WebDavHelper.php b/tests/acceptance/TestHelpers/WebDavHelper.php index f2d35ef18..77bd99b47 100644 --- a/tests/acceptance/TestHelpers/WebDavHelper.php +++ b/tests/acceptance/TestHelpers/WebDavHelper.php @@ -872,11 +872,6 @@ class WebDavHelper { return self::prefixRemotePhp("dav/trash-bin/$userOrItemIdOrSpaceIdOrToken"); } if ($davPathVersion === self::DAV_VERSION_OLD) { - if ($type === "public-files") { - // TODO: cleanup - // this endpoint does not exist - return self::prefixRemotePhp("public.php/webdav"); - } return self::prefixRemotePhp("webdav"); } elseif ($davPathVersion === self::DAV_VERSION_NEW) { if ($type === "files") { diff --git a/tests/acceptance/bootstrap/PublicWebDavContext.php b/tests/acceptance/bootstrap/PublicWebDavContext.php index d016f6e5b..9baf4ada6 100644 --- a/tests/acceptance/bootstrap/PublicWebDavContext.php +++ b/tests/acceptance/bootstrap/PublicWebDavContext.php @@ -37,77 +37,55 @@ require_once 'bootstrap.php'; class PublicWebDavContext implements Context { private FeatureContext $featureContext; - /** - * @param string $versionString (old|new) - * - * @return int - */ - public function getPublicDavVersion(string $versionString): int { - if ($versionString === "old") { - return WebDavHelper::DAV_VERSION_OLD; - } elseif ($versionString === "new") { - return WebDavHelper::DAV_VERSION_NEW; - } - throw new Exception("Unknown public WebDAV version: $versionString"); - } - /** * @param string $range ignore if empty - * @param string $publicWebDAVAPIVersion * @param string|null $password * * @return ResponseInterface */ - public function downloadPublicFileWithRange(string $range, string $publicWebDAVAPIVersion, ?string $password = ""):ResponseInterface { - if ($publicWebDAVAPIVersion === "new") { - // In this case a single file has been shared as a public link. - // Even if that file is somewhere down inside a folder(s), when - // 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 = (string) $this->featureContext->getLastCreatedPublicShare()->path; - $fullPathParts = \explode("/", $fullPath); - $path = \end($fullPathParts); - } else { - $path = ""; - } + public function downloadPublicFileWithRange(string $range, ?string $password = ""):ResponseInterface { + // In this case a single file has been shared as a public link. + // Even if that file is somewhere down inside a folder(s), when + // accessing it as a public link using the 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 = (string) $this->featureContext->getLastCreatedPublicShare()->path; + $fullPathParts = \explode("/", $fullPath); + $path = \end($fullPathParts); + return $this->downloadFileFromPublicFolder( $path, $password, - $range, - $publicWebDAVAPIVersion + $range ); } /** - * @When /^the public downloads the last public link shared file using the (old|new) public WebDAV API$/ - * @When /^the public tries to download the last public link shared file using the (old|new) public WebDAV API$/ - * - * @param string $publicWebDAVAPIVersion + * @When /^the public downloads the last public link shared file using the public WebDAV API$/ + * @When /^the public tries to download the last public link shared file using the public WebDAV API$/ * * @return void */ - public function downloadPublicFile(string $publicWebDAVAPIVersion):void { - $response = $this->downloadPublicFileWithRange("", $publicWebDAVAPIVersion); + public function downloadPublicFile():void { + $response = $this->downloadPublicFileWithRange(""); $this->featureContext->setResponse($response); } /** - * @When /^the public downloads the last public link shared file with password "([^"]*)" using the (old|new) public WebDAV API$/ - * @When /^the public tries to download the last public link shared file with password "([^"]*)" using the (old|new) public WebDAV API$/ + * @When /^the public downloads the last public link shared file with password "([^"]*)" using the public WebDAV API$/ + * @When /^the public tries to download the last public link shared file with password "([^"]*)" using the public WebDAV API$/ * * @param string $password - * @param string $publicWebDAVAPIVersion * * @return void */ - public function downloadPublicFileWithPassword(string $password, string $publicWebDAVAPIVersion):void { - $response = $this->downloadPublicFileWithRange("", $publicWebDAVAPIVersion, $password); + public function downloadPublicFileWithPassword(string $password):void { + $response = $this->downloadPublicFileWithRange("", $password); $this->featureContext->setResponse($response); } /** - * @When /^user "([^"]*)" tries to download file "([^"]*)" from the last public link using own basic auth and new public WebDAV API$/ + * @When /^user "([^"]*)" tries to download file "([^"]*)" from the last public link using own basic auth and public WebDAV API$/ * * @param string $user * @param string $path @@ -120,17 +98,15 @@ class PublicWebDavContext implements Context { } /** - * @When /^the public deletes (?:file|folder|entry) "([^"]*)" from the last public link share using the (old|new) public WebDAV API$/ + * @When /^the public deletes (?:file|folder|entry) "([^"]*)" from the last public link share using the public WebDAV API$/ * * @param string $fileName - * @param string $publicWebDAVAPIVersion * * @return void */ - public function thePublicDeletesFileFolderFromTheLastPublicLinkShareUsingThePublicWebdavApi(string $fileName, string $publicWebDAVAPIVersion):void { + public function thePublicDeletesFileFolderFromTheLastPublicLinkShareUsingThePublicWebdavApi(string $fileName):void { $response = $this->deleteFileFromPublicShare( - $fileName, - $publicWebDAVAPIVersion + $fileName ); $this->featureContext->setResponse($response); $this->featureContext->pushToLastStatusCodesArrays(); @@ -145,7 +121,7 @@ class PublicWebDavContext implements Context { public function deleteFileFromPublicShare(string $fileName, string $password = ""): ResponseInterface { $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); $davPath = WebDavHelper::getDavPath( - $this->getPublicDavVersion("new"), + WebDavHelper::DAV_VERSION_NEW, $token, "public-files" ); @@ -153,8 +129,7 @@ class PublicWebDavContext implements Context { $fullUrl = $this->featureContext->getBaseUrl() . "/$davPath/$fileName"; $userName = $this->getUsernameForPublicWebdavApi( $token, - $password, - "new" + $password ); $headers = [ 'X-Requested-With' => 'XMLHttpRequest' @@ -197,35 +172,16 @@ class PublicWebDavContext implements Context { } /** - * @When /^the public renames (?:file|folder|entry) "([^"]*)" to "([^"]*)" from the last public link share using the (old|new) public WebDAV API$/ - * * @param string $fileName * @param string $toFileName - * @param string $publicWebDAVAPIVersion - * @param string|null $password - * - * @return void - */ - public function thePublicRenamesFileFolderFromTheLastPublicShareUsingPublicWebdavApi(string $fileName, string $toFileName, string $publicWebDAVAPIVersion, ?string $password = ""):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } - $this->featureContext->setResponse($this->renameFileFromPublicShare($fileName, $toFileName, $publicWebDAVAPIVersion, $password)); - $this->featureContext->pushToLastStatusCodesArrays(); - } - - /** - * @param string $fileName - * @param string $toFileName - * @param string $publicWebDAVAPIVersion * @param string|null $password * * @return ResponseInterface */ - public function renameFileFromPublicShare(string $fileName, string $toFileName, string $publicWebDAVAPIVersion, ?string $password = ""):ResponseInterface { + public function renameFileFromPublicShare(string $fileName, string $toFileName, ?string $password = ""):ResponseInterface { $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); $davPath = WebDavHelper::getDavPath( - $this->getPublicDavVersion($publicWebDAVAPIVersion), + WebDavHelper::DAV_VERSION_NEW, $token, "public-files" ); @@ -234,8 +190,7 @@ class PublicWebDavContext implements Context { $destination = $this->featureContext->getBaseUrl() . "/$davPath/$toFileName"; $userName = $this->getUsernameForPublicWebdavApi( $token, - $password, - $publicWebDAVAPIVersion + $password ); $headers = [ 'X-Requested-With' => 'XMLHttpRequest', @@ -252,83 +207,41 @@ class PublicWebDavContext implements Context { } /** - * @When /^the public renames (?:file|folder|entry) "([^"]*)" to "([^"]*)" from the last public link share using the password "([^"]*)" and the (old|new) public WebDAV API$/ + * @When /^the public renames (?:file|folder|entry) "([^"]*)" to "([^"]*)" from the last public link share using the password "([^"]*)" and the public WebDAV API$/ * * @param string $fileName * @param string $toName * @param string $password - * @param string $publicWebDAVAPIVersion * * @return void */ - public function thePublicRenamesFileFromTheLastPublicShareUsingThePasswordPasswordAndOldPublicWebdavApi(string $fileName, string $toName, string $password, string $publicWebDAVAPIVersion):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } + public function thePublicRenamesFileFromTheLastPublicShareUsingThePasswordPasswordAndOldPublicWebdavApi(string $fileName, string $toName, string $password):void { + $this->featureContext->setResponse( - $this->renameFileFromPublicShare($fileName, $toName, $publicWebDAVAPIVersion, $password) + $this->renameFileFromPublicShare($fileName, $toName, $password) ); $this->featureContext->pushToLastStatusCodesArrays(); } /** - * @When /^the public downloads file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API$/ - * - * @param string $path - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function downloadPublicFileInsideAFolder(string $path, string $publicWebDAVAPIVersion = "old"):void { - $response = $this->downloadFileFromPublicFolder( - $path, - "", - "", - $publicWebDAVAPIVersion - ); - $this->featureContext->setResponse($response); - } - - /** - * @When /^the public downloads file "([^"]*)" from inside the last public link shared folder with password "([^"]*)" using the (old|new) public WebDAV API$/ - * @When /^the public tries to download file "([^"]*)" from inside the last public link shared folder with password "([^"]*)" using the (old|new) public WebDAV API$/ + * @When /^the public downloads file "([^"]*)" from inside the last public link shared folder with password "([^"]*)" using the public WebDAV API$/ + * @When /^the public tries to download file "([^"]*)" from inside the last public link shared folder with password "([^"]*)" using the public WebDAV API$/ * * @param string $path * @param string $password - * @param string $publicWebDAVAPIVersion * * @return void */ - public function publicDownloadsFileFromInsideLastPublicSharedFolderWithPassword(string $path, string $password = "", string $publicWebDAVAPIVersion = "old"):void { + public function publicDownloadsFileFromInsideLastPublicSharedFolderWithPassword(string $path, string $password = ""):void { $response = $this->downloadFileFromPublicFolder( $path, $password, "", - $publicWebDAVAPIVersion, $this->featureContext->isUsingSharingNG() ); $this->featureContext->setResponse($response); } - /** - * @When /^the public downloads file "([^"]*)" from inside the last public link shared folder with range "([^"]*)" using the (old|new) public WebDAV API$/ - * - * @param string $path - * @param string $range - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function downloadPublicFileInsideAFolderWithRange(string $path, string $range, string $publicWebDAVAPIVersion):void { - $response = $this->downloadFileFromPublicFolder( - $path, - "", - $range, - $publicWebDAVAPIVersion - ); - $this->featureContext->setResponse($response); - } - /** * @param string $path * @param string $user @@ -360,7 +273,6 @@ class PublicWebDavContext implements Context { * @param string $path * @param string $password * @param string $range ignored when empty - * @param string $publicWebDAVAPIVersion * @param bool $shareNg * * @return ResponseInterface @@ -369,7 +281,6 @@ class PublicWebDavContext implements Context { string $path, string $password, string $range, - string $publicWebDAVAPIVersion = "old", bool $shareNg = false ):ResponseInterface { $path = \ltrim($path, "/"); @@ -380,15 +291,14 @@ class PublicWebDavContext implements Context { $token = $this->featureContext->getLastCreatedPublicShareToken(); } $davPath = WebDavHelper::getDavPath( - $this->getPublicDavVersion($publicWebDAVAPIVersion), + WebDavHelper::DAV_VERSION_NEW, $token, "public-files" ); $fullUrl = $this->featureContext->getBaseUrl() . "/$davPath/$path"; $userName = $this->getUsernameForPublicWebdavApi( $token, - $password, - $publicWebDAVAPIVersion + $password ); $headers = [ @@ -408,37 +318,17 @@ class PublicWebDavContext implements Context { /** * @param string $source target file name - * @param string $publicWebDAVAPIVersion * * @return ResponseInterface */ - public function publicUploadFile(string $source, string $publicWebDAVAPIVersion):ResponseInterface { + public function publicUploadFile(string $source):ResponseInterface { return $this->publicUploadContent( \basename($source), '', - \file_get_contents($source), - false, - [], - $publicWebDAVAPIVersion + \file_get_contents($source) ); } - /** - * @When the public uploads file :filename using the :publicWebDAVAPIVersion WebDAV API - * - * @param string $source target file name - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function thePublicUploadsFileUsingTheWebDAVApi(string $source, string $publicWebDAVAPIVersion):void { - $response = $this->publiclUploadFile( - $source, - $publicWebDAVAPIVersion - ); - $this->featureContext->setResponse($response); - } - /** * * @param string $baseUrl URL of owncloud @@ -473,18 +363,17 @@ class PublicWebDavContext implements Context { } /** - * @When /^the public copies (?:file|folder) "([^"]*)" to "([^"]*)" using the (old|new) public WebDAV API$/ + * @When /^the public copies (?:file|folder) "([^"]*)" to "([^"]*)" using the public WebDAV API$/ * * @param string $source * @param string $destination - * @param string $publicWebDAVAPIVersion * * @return void */ - public function thePublicCopiesFileUsingTheWebDAVApi(string $source, string $destination, string $publicWebDAVAPIVersion):void { + public function thePublicCopiesFileUsingTheWebDAVApi(string $source, string $destination):void { $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); $davPath = WebDavHelper::getDavPath( - $this->getPublicDavVersion($publicWebDAVAPIVersion), + WebDavHelper::DAV_VERSION_NEW, $token, "public-files" ); @@ -498,22 +387,6 @@ class PublicWebDavContext implements Context { $this->featureContext->setResponse($response); } - /** - * @Given the public has uploaded file :filename - * - * @param string $source target file name - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function thePublicHasUploadedFileUsingTheWebDAVApi(string $source, string $publicWebDAVAPIVersion):void { - $response = $this->publicUploadFile( - $source, - $publicWebDAVAPIVersion - ); - $this->featureContext->theHTTPStatusCodeShouldBe([201, 204], "", $response); - } - /** * This only works with the old API, auto-rename is not supported in the new API * auto renaming is handled on files drop folders implicitly @@ -593,102 +466,43 @@ class PublicWebDavContext implements Context { } /** - * @When /^the public uploads file "([^"]*)" with password "([^"]*)" and content "([^"]*)" using the (old|new) public WebDAV API$/ + * @When /^the public uploads file "([^"]*)" with password "([^"]*)" and content "([^"]*)" using the public WebDAV API$/ * * @param string $filename target file name - * @param string|null $password + * @param string $password * @param string $body content to upload - * @param string $publicWebDAVAPIVersion * * @return void */ public function thePublicUploadsFileWithPasswordAndContentUsingPublicWebDAVApi( string $filename, - ?string $password = '', - string $body = 'test', - string $publicWebDAVAPIVersion = "old" + string $password, + string $body, ):void { $response = $this->publiclyUploadingContentWithPassword( $filename, $password, - $body, - $publicWebDAVAPIVersion - ); - $this->featureContext->setResponse($response); - } - - /** - * @Given the public has uploaded file :filename with password :password and content :body - * - * @param string $filename target file name - * @param string|null $password - * @param string $body content to upload - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function thePublicHasUploadedFileWithPasswordAndContentUsingPublicWebDAVApi( - string $filename, - ?string $password = '', - string $body = 'test', - string $publicWebDAVAPIVersion = "old" - ):void { - $response = $this->publiclyUploadingContentWithPassword( - $filename, - $password, - $body, - $publicWebDAVAPIVersion - ); - $this->featureContext->theHTTPStatusCodeShouldBe([201, 204], "", $response); - } - - /** - * @param string $filename target file name - * @param string $body content to upload - * @param string $publicWebDAVAPIVersion - * - * @return ResponseInterface - */ - public function publiclyOverwritingContent(string $filename, string $body = 'test', string $publicWebDAVAPIVersion = 'old'):ResponseInterface { - return $this->publicUploadContent($filename, '', $body, false, [], $publicWebDAVAPIVersion); - } - - /** - * @When the public overwrites file :filename with content :body using the :type WebDAV API - * - * @param string $filename target file name - * @param string $body content to upload - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function thePublicOverwritesFileWithContentUsingWebDavApi(string $filename, string $body = 'test', string $publicWebDAVAPIVersion = 'old'):void { - $response = $this->publiclyOverwritingContent( - $filename, - $body, - $publicWebDAVAPIVersion - ); - $this->featureContext->setResponse($response); - } - - /** - * @Given the public has overwritten file :filename with content :body - * - * @param string $filename target file name - * @param string $body content to upload - * - * @return void - */ - public function thePublicHasOverwrittenFileWithContentUsingOldWebDavApi(string $filename, string $body = 'test'):void { - $response = $this->publiclyOverwritingContent( - $filename, $body ); - $this->featureContext->theHTTPStatusCodeShouldBe(204, "", $response); + $this->featureContext->setResponse($response); } /** - * @When /^the public uploads file "([^"]*)" with content "([^"]*)" using the (?:old|new) public WebDAV API$/ + * @When the public overwrites file :filename with content :body using the public WebDAV API + * + * @param string $filename target file name + * @param string $body content to upload + * + * @return void + */ + public function thePublicOverwritesFileWithContentUsingWebDavApi(string $filename, string $body):void { + + $response = $this->publicUploadContent($filename, '', $body); + $this->featureContext->setResponse($response); + } + + /** + * @When /^the public uploads file "([^"]*)" with content "([^"]*)" using the public WebDAV API$/ * * @param string $filename target file name * @param string $body content to upload @@ -718,49 +532,8 @@ class PublicWebDavContext implements Context { } /** - * @Then /^the public should be able to download the last publicly shared file using the (old|new) public WebDAV API without a password and the content should be "([^"]*)"$/ + * @Then /^the public should be able to download the last publicly shared file using the public WebDAV API with password "([^"]*)" and the content should be "([^"]*)"$/ * - * @param string $publicWebDAVAPIVersion - * @param string $expectedContent - * - * @return void - * @throws Exception - */ - public function checkLastPublicSharedFileDownload( - string $publicWebDAVAPIVersion, - string $expectedContent - ):void { - $this->checkLastPublicSharedFileWithPasswordDownload( - $publicWebDAVAPIVersion, - "", - $expectedContent - ); - } - - /** - * @Then /^the public should be able to download the last publicly shared file using the (old|new) public WebDAV API without a password and the content should be "([^"]*)" plus end-of-line$/ - * - * @param string $publicWebDAVAPIVersion - * @param string $expectedContent - * - * @return void - * @throws Exception - */ - public function checkLastPublicSharedFileDownloadPlusEndOfLine( - string $publicWebDAVAPIVersion, - string $expectedContent - ):void { - $this->checkLastPublicSharedFileWithPasswordDownload( - $publicWebDAVAPIVersion, - "", - "$expectedContent\n" - ); - } - - /** - * @Then /^the public should be able to download the last publicly shared file using the (old|new) public WebDAV API with password "([^"]*)" and the content should be "([^"]*)"$/ - * - * @param string $publicWebDAVAPIVersion * @param string $password * @param string $expectedContent * @@ -768,17 +541,12 @@ class PublicWebDavContext implements Context { * @throws Exception */ public function checkLastPublicSharedFileWithPasswordDownload( - string $publicWebDAVAPIVersion, string $password, string $expectedContent ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } $response = $this->downloadPublicFileWithRange( "", - $publicWebDAVAPIVersion, $password ); @@ -786,183 +554,58 @@ class PublicWebDavContext implements Context { $this->featureContext->checkDownloadedContentMatches( $expectedContent, - "Checking the content of the last public shared file after downloading with the $publicWebDAVAPIVersion public WebDAV API", + "Checking the content of the last public shared file after downloading with the public WebDAV API", $response ); } /** - * @Then /^the public download of the last publicly shared file using the (old|new) public WebDAV API with password "([^"]*)" should fail with HTTP status code "([^"]*)"$/ - * - * @param string $publicWebDAVAPIVersion - * @param string $password - * @param string $expectedHttpCode - * - * @return void - */ - public function theLastPublicSharedFileShouldNotBeAbleToBeDownloadedWithPassword( - string $publicWebDAVAPIVersion, - string $password, - string $expectedHttpCode - ):void { - $response = $this->downloadPublicFileWithRange( - "", - $publicWebDAVAPIVersion, - $password - ); - $responseContent = $response->getBody()->getContents(); - \libxml_use_internal_errors(true); - Assert::assertNotFalse( - \simplexml_load_string($responseContent), - "response body is not valid XML, maybe download did work\n" . - "response body: \n$responseContent\n" - ); - $this->featureContext->theHTTPStatusCodeShouldBe($expectedHttpCode, "", $response); - } - - /** - * @Then /^the public download of the last publicly shared file using the (old|new) public WebDAV API without a password should fail with HTTP status code "([^"]*)"$/ - * - * @param string $publicWebDAVAPIVersion - * @param string $expectedHttpCode - * - * @return void - */ - public function theLastPublicSharedFileShouldNotBeAbleToBeDownloadedWithoutAPassword( - string $publicWebDAVAPIVersion, - string $expectedHttpCode - ):void { - $response = $this->downloadPublicFileWithRange( - "", - $publicWebDAVAPIVersion, - $expectedHttpCode - ); - $responseContent = $response->getBody()->getContents(); - \libxml_use_internal_errors(true); - Assert::assertNotFalse( - \simplexml_load_string($responseContent), - "response body is not valid XML, maybe download did work\n" . - "response body: \n$responseContent\n" - ); - $this->featureContext->theHTTPStatusCodeShouldBe($expectedHttpCode, "", $response); - } - - /** - * @Then /^the public should be able to download file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API$/ + * @Then /^the public should not be able to download file "([^"]*)" from inside the last public link shared folder using the public WebDAV API without a password$/ + * @Then /^the public download of file "([^"]*)" from inside the last public link shared folder using the public WebDAV API should fail with HTTP status code "([^"]*)"$/ * * @param string $path - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function shouldBeAbleToDownloadFileInsidePublicSharedFolder( - string $path, - string $publicWebDAVAPIVersion - ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } - - $response = $this->downloadFileFromPublicFolder( - $path, - "", - "", - $publicWebDAVAPIVersion - ); - $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); - } - - /** - * @Then /^the public should not be able to download file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API without a password$/ - * @Then /^the public download of file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API should fail with HTTP status code "([^"]*)"$/ - * - * @param string $path - * @param string $publicWebDAVAPIVersion * @param string $expectedHttpCode * * @return void */ public function shouldNotBeAbleToDownloadFileInsidePublicSharedFolder( string $path, - string $publicWebDAVAPIVersion, string $expectedHttpCode = "401" ):void { - $this->tryingToDownloadUsingWebDAVAPI( + $response = $this->downloadFileFromPublicFolder( $path, - $publicWebDAVAPIVersion, "", "", - $expectedHttpCode, $this->featureContext->isUsingSharingNG() ); + $this->featureContext->theHTTPStatusCodeShouldBe($expectedHttpCode, "", $response); } /** - * @Then /^the public should be able to download file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)"$/ + * @Then /^the public should be able to download file "([^"]*)" from inside the last public link shared folder using the public WebDAV API with password "([^"]*)"$/ * * @param string $path - * @param string $publicWebDAVAPIVersion * @param string $password * * @return void */ public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithPassword( string $path, - string $publicWebDAVAPIVersion, string $password ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } - $response = $this->downloadFileFromPublicFolder( $path, $password, "", - $publicWebDAVAPIVersion, $this->featureContext->isUsingSharingNG() ); $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); } /** - * @Then /^the public should be able to download file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)" and the content should be "([^"]*)" plus end-of-line$/ + * @Then /^the public should be able to download file "([^"]*)" from inside the last public link shared folder using the public WebDAV API with password "([^"]*)" and the content should be "([^"]*)"$/ * * @param string $path - * @param string $publicWebDAVAPIVersion - * @param string $password - * @param string $content - * - * @return void - * @throws Exception - */ - public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithPasswordAndEOL( - string $path, - string $publicWebDAVAPIVersion, - string $password, - string $content - ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } - - $response = $this->downloadFileFromPublicFolder( - $path, - $password, - "", - $publicWebDAVAPIVersion - ); - - $this->featureContext->checkDownloadedContentMatches("$content\n", "", $response); - - $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); - } - - /** - * @Then /^the public should be able to download file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)" and the content should be "([^"]*)"$/ - * - * @param string $path - * @param string $publicWebDAVAPIVersion * @param string $password * @param string $content * @@ -971,19 +614,14 @@ class PublicWebDavContext implements Context { */ public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithPasswordAndContentShouldBe( string $path, - string $publicWebDAVAPIVersion, string $password, string $content ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } $response = $this->downloadFileFromPublicFolder( $path, $password, "", - $publicWebDAVAPIVersion ); $this->featureContext->checkDownloadedContentMatches($content, "", $response); @@ -1009,7 +647,6 @@ class PublicWebDavContext implements Context { $path, $password, "", - "new", true ); @@ -1018,41 +655,10 @@ class PublicWebDavContext implements Context { } /** - * @Then /^the public should be able to download file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API without password and the content should be "([^"]*)"$/ + * @Then /^the public should not be able to download file "([^"]*)" from inside the last public link shared folder using the public WebDAV API with password "([^"]*)"$/ + * @Then /^the public download of file "([^"]*)" from inside the last public link shared folder using the public WebDAV API with password "([^"]*)" should fail with HTTP status code "([^"]*)"$/ * * @param string $path - * @param string $publicWebDAVAPIVersion - * @param string $content - * - * @return void - * @throws Exception - */ - public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithoutPassword( - string $path, - string $publicWebDAVAPIVersion, - string $content - ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } - - $response = $this->downloadFileFromPublicFolder( - $path, - "", - "", - $publicWebDAVAPIVersion - ); - $this->featureContext->checkDownloadedContentMatches($content, "", $response); - - $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); - } - - /** - * @Then /^the public should not be able to download file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)"$/ - * @Then /^the public download of file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)" should fail with HTTP status code "([^"]*)"$/ - * - * @param string $path - * @param string $publicWebDAVAPIVersion * @param string $password * @param string $expectedHttpCode * @@ -1060,18 +666,16 @@ class PublicWebDavContext implements Context { */ public function shouldNotBeAbleToDownloadFileInsidePublicSharedFolderWithPassword( string $path, - string $publicWebDAVAPIVersion, string $password, string $expectedHttpCode = "401" ):void { - $this->tryingToDownloadUsingWebDAVAPI( + $response = $this->downloadFileFromPublicFolder( $path, - $publicWebDAVAPIVersion, $password, "", - $expectedHttpCode, $this->featureContext->isUsingSharingNG() ); + $this->featureContext->theHTTPStatusCodeShouldBe($expectedHttpCode, "", $response); } /** @@ -1092,70 +696,13 @@ class PublicWebDavContext implements Context { $path, "new", $password, - "", $expectedHttpCode, true ); } /** - * @Then /^the public should be able to download the range "([^"]*)" of file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)""$/ - * - * @param string $range * @param string $path - * @param string $publicWebDAVAPIVersion - * @param string $password - * - * @return void - * @throws Exception - */ - public function shouldBeAbleToDownloadRangeOfFileInsidePublicSharedFolderWithPassword( - string $range, - string $path, - string $publicWebDAVAPIVersion, - string $password - ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } - - $response = $this->downloadFileFromPublicFolder( - $path, - $password, - $range, - $publicWebDAVAPIVersion - ); - $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); - } - - /** - * @Then /^the public should not be able to download the range "([^"]*)" of file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)"$/ - * @Then /^the public should not be able to download the range "([^"]*)" of file "([^"]*)" from inside the last public link shared folder using the (old|new) public WebDAV API without a password$/ - * - * @param string $range - * @param string $path - * @param string $publicWebDAVAPIVersion - * @param string $password - * @param string $expectedHttpCode - * @param bool $shareNg - * - * @return void - * @throws Exception - */ - public function shouldNotBeAbleToDownloadRangeOfFileInsidePublicSharedFolderWithPassword( - string $range, - string $path, - string $publicWebDAVAPIVersion, - string $password = "", - string $expectedHttpCode = "401", - bool $shareNg = false - ):void { - $this->tryingToDownloadUsingWebDAVAPI($path, $publicWebDAVAPIVersion, $password, $range, $expectedHttpCode, $shareNg); - } - - /** - * @param string $path - * @param string $publicWebDAVAPIVersion * @param string $password * @param string $range * @param string $expectedHttpCode @@ -1165,30 +712,23 @@ class PublicWebDavContext implements Context { */ public function tryingToDownloadUsingWebDAVAPI( string $path, - string $publicWebDAVAPIVersion, string $password, string $range = "", string $expectedHttpCode = "401", bool $shareNg = false ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } - $response = $this->downloadFileFromPublicFolder( $path, $password, $range, - $publicWebDAVAPIVersion, $shareNg ); $this->featureContext->theHTTPStatusCodeShouldBe($expectedHttpCode, "", $response); } /** - * @Then /^the public upload to the last publicly shared file using the (old|new) public WebDAV API with password "([^"]*)" should (?:fail|pass) with HTTP status code "([^"]*)"$/ + * @Then /^the public upload to the last publicly shared file using the public WebDAV API with password "([^"]*)" should (?:fail|pass) with HTTP status code "([^"]*)"$/ * - * @param string $publicWebDAVAPIVersion * @param string $password * @param string $expectedHttpCode * @@ -1196,83 +736,34 @@ class PublicWebDavContext implements Context { * @throws Exception */ public function publiclyUploadingShouldToSharedFileShouldFail( - string $publicWebDAVAPIVersion, string $password, string $expectedHttpCode ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } $filename = (string)$this->featureContext->getLastCreatedPublicShare()->file_target; $response = $this->publicUploadContent( $filename, - $password, - 'test', - false, - [], - $publicWebDAVAPIVersion + $password ); $this->featureContext->theHTTPStatusCodeShouldBe($expectedHttpCode, "", $response); } /** - * @Then /^the public upload to the last publicly shared folder using the (old|new) public WebDAV API should fail with HTTP status code "([^"]*)"$/ + * @Then /^the public upload to the last publicly shared folder using the public WebDAV API with password "([^"]*)" should fail with HTTP status code "([^"]*)"$/ * - * @param string $publicWebDAVAPIVersion - * @param string|null $expectedHttpCode - * - * @return void - */ - public function publiclyUploadingShouldNotWork( - string $publicWebDAVAPIVersion, - string $expectedHttpCode = null - ):void { - $response = $this->publicUploadContent( - 'whateverfilefortesting.txt', - '', - 'test', - false, - [], - $publicWebDAVAPIVersion - ); - - if ($expectedHttpCode === null) { - $expectedHttpCode = [507, 400, 401, 403, 404, 423]; - } - $this->featureContext->theHTTPStatusCodeShouldBe( - $expectedHttpCode, - "upload should have failed but passed with code " . - $response->getStatusCode(), - $response - ); - } - - /** - * @Then /^the public upload to the last publicly shared folder using the (old|new) public WebDAV API with password "([^"]*)" should fail with HTTP status code "([^"]*)"$/ - * - * @param string $publicWebDAVAPIVersion * @param string $password * @param string|null $expectedHttpCode * * @return void */ public function publiclyUploadingWithPasswordShouldNotWork( - string $publicWebDAVAPIVersion, string $password, string $expectedHttpCode = null ):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } $response = $this->publicUploadContent( 'whateverfilefortesting.txt', - $password, - 'test', - false, - [], - $publicWebDAVAPIVersion + $password ); Assert::assertGreaterThanOrEqual( $expectedHttpCode, @@ -1282,88 +773,41 @@ class PublicWebDavContext implements Context { } /** - * @Then /^the public should be able to upload file "([^"]*)" into the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)"$/ + * @Then /^the public should be able to upload file "([^"]*)" into the last public link shared folder using the public WebDAV API with password "([^"]*)"$/ * * @param string $filename - * @param string $publicWebDAVAPIVersion * @param string $password * * @return void */ public function publiclyUploadingIntoFolderWithPasswordShouldWork( string $filename, - string $publicWebDAVAPIVersion, string $password ):void { $response = $this->publicUploadContent( $filename, - $password, - 'test', - false, - [], - $publicWebDAVAPIVersion + $password ); $this->featureContext->theHTTPStatusCodeShouldBe([201, 204], "", $response); } /** - * @Then /^the public upload of file "([^"]*)" into the last public link shared folder using the (old|new) public WebDAV API with password "([^"]*)" should fail with HTTP status code "([^"]*)"$/ - * - * @param string $filename - * @param string $publicWebDAVAPIVersion - * @param string $password - * @param string $expectedHttpCode - * - * @return void - */ - public function publiclyUploadingIntoFolderWithPasswordShouldFail( - string $filename, - string $publicWebDAVAPIVersion, - string $password, - string $expectedHttpCode - ):void { - $response = $this->publicUploadContent( - $filename, - $password, - 'test', - false, - [], - $publicWebDAVAPIVersion - ); - - $this->featureContext->theHTTPStatusCodeShouldBe( - $expectedHttpCode, - "upload of $filename into the last publicly shared folder should have failed with code " . - $expectedHttpCode . " but the code was " . $response->getStatusCode(), - $response - ); - } - - /** - * @Then /^uploading a file with password "([^"]*)" should work using the (old|new) public WebDAV API$/ + * @Then /^uploading a file with password "([^"]*)" should work using the public WebDAV API$/ * * @param string $password - * @param string $publicWebDAVAPIVersion * * @return void * @throws Exception */ - public function publiclyUploadingShouldWork(string $password, string $publicWebDAVAPIVersion):void { - $path = "whateverfilefortesting-$publicWebDAVAPIVersion-publicWebDAVAPI.txt"; - $content = "test $publicWebDAVAPIVersion"; - - if ($publicWebDAVAPIVersion === "old") { - return; - } + public function publiclyUploadingShouldWork(string $password):void { + $path = "whateverfilefortesting-publicWebDAVAPI.txt"; + $content = "test"; $response = $this->publicUploadContent( $path, $password, $content, - false, - [], - $publicWebDAVAPIVersion ); Assert::assertTrue( @@ -1374,19 +818,17 @@ class PublicWebDavContext implements Context { $response = $this->downloadFileFromPublicFolder( $path, $password, - "", - $publicWebDAVAPIVersion + "" ); $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); $this->featureContext->checkDownloadedContentMatches($content, "", $response); } /** - * @Then /^uploading content to a public link shared file with password "([^"]*)" should (not|)\s?work using the (old|new) public WebDAV API$/ + * @Then /^uploading content to a public link shared file with password "([^"]*)" should (not|)\s?work using the public WebDAV API$/ * * @param string $password * @param string $shouldOrNot (not|) - * @param string $publicWebDAVAPIVersion * * @return void * @throws Exception @@ -1394,25 +836,15 @@ class PublicWebDavContext implements Context { public function publiclyUploadingToPublicLinkSharedFileShouldWork( string $password, string $shouldOrNot, - string $publicWebDAVAPIVersion ):void { - $content = "test $publicWebDAVAPIVersion"; + $content = "test"; $should = ($shouldOrNot !== "not"); - if ($publicWebDAVAPIVersion === "old") { - return; - } elseif ($publicWebDAVAPIVersion === "new") { - $path = (string) $this->featureContext->getLastCreatedPublicShare()->path; - } else { - $path = ""; - } + $path = (string) $this->featureContext->getLastCreatedPublicShare()->path; $response = $this->publicUploadContent( $path, $password, - $content, - false, - [], - $publicWebDAVAPIVersion + $content ); if ($should) { Assert::assertTrue( @@ -1423,13 +855,12 @@ class PublicWebDavContext implements Context { $response = $this->downloadPublicFileWithRange( "", - $publicWebDAVAPIVersion, $password ); $this->featureContext->checkDownloadedContentMatches( $content, - "Checking the content of the last public shared file after downloading with the $publicWebDAVAPIVersion public WebDAV API", + "Checking the content of the last public shared file after downloading with the public WebDAV API", $response ); } else { @@ -1443,18 +874,16 @@ class PublicWebDavContext implements Context { } /** - * @When the public uploads file :source to :destination inside last link shared folder using the :new WebDAV API + * @When the public uploads file :source to :destination inside last link shared folder using the public WebDAV API * * @param string $source * @param string $destination - * @param string $publicWebDAVAPIVersion * * @return void */ - public function thePublicUploadsFileToInsideLastLinkSharedFolderUsingTheNewWebdavApi( + public function thePublicUploadsFileToInsideLastLinkSharedFolderUsingThePublicWebdavApi( string $source, string $destination, - string $publicWebDAVAPIVersion ):void { $content = \file_get_contents( $this->featureContext->acceptanceTestsDirLocation() . $source @@ -1462,30 +891,25 @@ class PublicWebDavContext implements Context { $response = $this->publicUploadContent( $destination, '', - $content, - false, - [], - $publicWebDAVAPIVersion + $content ); $this->featureContext->setResponse($response); } /** * - * @When the public uploads file :source to :destination inside last link shared folder with password :password using the :new WebDAV API + * @When the public uploads file :source to :destination inside last link shared folder with password :password using the public WebDAV API * * @param string $source * @param string $destination * @param string $password - * @param string $publicWebDAVAPIVersion * * @return void */ - public function thePublicUploadsFileToInsideLastLinkSharedFolderWithPasswordUsingTheNewWebdavApi( + public function thePublicUploadsFileToInsideLastLinkSharedFolderWithPasswordUsingThePublicWebdavApi( string $source, string $destination, - string $password, - string $publicWebDAVAPIVersion + string $password ):void { $content = \file_get_contents( $this->featureContext->acceptanceTestsDirLocation() . $source @@ -1493,21 +917,17 @@ class PublicWebDavContext implements Context { $response = $this->publicUploadContent( $destination, $password, - $content, - false, - [], - $publicWebDAVAPIVersion + $content ); $this->featureContext->setResponse($response); } /** - * @When the public uploads file :fileName to the last public link shared folder with password :password with mtime :mtime using the :davVersion public WebDAV API + * @When the public uploads file :fileName to the last public link shared folder with password :password with mtime :mtime using the public WebDAV API * * @param string $fileName * @param string $password * @param string $mtime - * @param string $davVersion * * @return void * @throws Exception @@ -1515,8 +935,7 @@ class PublicWebDavContext implements Context { public function thePublicUploadsFileToLastSharedFolderWithMtimeUsingTheWebdavApi( string $fileName, string $password, - string $mtime, - string $davVersion = "old" + string $mtime ):void { $mtime = new DateTime($mtime); $mtime = $mtime->format('U'); @@ -1526,8 +945,7 @@ class PublicWebDavContext implements Context { $password, 'test', false, - ["X-OC-Mtime" => $mtime], - $davVersion + ["X-OC-Mtime" => $mtime] ); $this->featureContext->setResponse($response); } @@ -1552,8 +970,7 @@ class PublicWebDavContext implements Context { $password = $this->featureContext->getActualPassword($password); $userName = $this->getUsernameForPublicWebdavApi( $token, - $password, - "new" + $password ); $foldername = \implode( '/', @@ -1571,7 +988,7 @@ class PublicWebDavContext implements Context { } /** - * @When the public creates folder :destination using the new public WebDAV API + * @When the public creates folder :destination using the public WebDAV API * * @param String $destination * @@ -1700,14 +1117,13 @@ class PublicWebDavContext implements Context { $token = $this->featureContext->getLastCreatedPublicShareToken(); } $davPath = WebDavHelper::getDavPath( - $this->getPublicDavVersion("new"), + WebDavHelper::DAV_VERSION_NEW, $token, "public-files" ); $userName = $this->getUsernameForPublicWebdavApi( $token, - $password, - "new" + $password ); $filename = \implode( @@ -1739,23 +1155,17 @@ class PublicWebDavContext implements Context { /** * @param string $token * @param string $password - * @param string $publicWebDAVAPIVersion * * @return string|null */ private function getUsernameForPublicWebdavApi( string $token, - string $password, - string $publicWebDAVAPIVersion + string $password ):?string { - if ($publicWebDAVAPIVersion === "old") { - $userName = $token; + if ($password !== '') { + $userName = 'public'; } else { - if ($password !== '') { - $userName = 'public'; - } else { - $userName = null; - } + $userName = null; } return $userName; } @@ -1775,19 +1185,15 @@ class PublicWebDavContext implements Context { } /** - * @When /^the public sends "([^"]*)" request to the last public link share using the (old|new) public WebDAV API(?: with password "([^"]*)")?$/ + * @When /^the public sends "([^"]*)" request to the last public link share using the public WebDAV API(?: with password "([^"]*)")?$/ * * @param string $method - * @param string $publicWebDAVAPIVersion * @param string|null $password * * @return void * @throws GuzzleException */ - public function publicSendsRequestToLastPublicShare(string $method, string $publicWebDAVAPIVersion, ?string $password = ''):void { - if ($publicWebDAVAPIVersion === "old") { - return; - } + public function publicSendsRequestToLastPublicShare(string $method, ?string $password = ''):void { if ($method === "PROPFIND") { $body = ' @@ -1805,15 +1211,14 @@ class PublicWebDavContext implements Context { } $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); $davPath = WebDavHelper::getDavPath( - $this->getPublicDavVersion($publicWebDAVAPIVersion), + WebDavHelper::DAV_VERSION_NEW, $token, "public-files" ); $password = $this->featureContext->getActualPassword($password); $username = $this->getUsernameForPublicWebdavApi( $token, - $password, - $publicWebDAVAPIVersion + $password ); $fullUrl = $this->featureContext->getBaseUrl() . "/$davPath"; $response = HttpRequestHelper::sendRequest( diff --git a/tests/acceptance/bootstrap/WebDavLockingContext.php b/tests/acceptance/bootstrap/WebDavLockingContext.php index f8756324f..0ffeb4e01 100644 --- a/tests/acceptance/bootstrap/WebDavLockingContext.php +++ b/tests/acceptance/bootstrap/WebDavLockingContext.php @@ -394,18 +394,16 @@ class WebDavLockingContext implements Context { } /** - * @When /^the public locks "([^"]*)" in the last public link shared folder using the (old|new) public WebDAV API setting the following properties$/ - * @When /^the public tries to lock "([^"]*)" in the last public link shared folder using the (old|new) public WebDAV API setting the following properties$/ + * @When /^the public locks "([^"]*)" in the last public link shared folder using the public WebDAV API setting the following properties$/ + * @When /^the public tries to lock "([^"]*)" in the last public link shared folder using the public WebDAV API setting the following properties$/ * * @param string $file - * @param string $publicWebDAVAPIVersion * @param TableNode $properties * * @return void */ public function publicLocksFileLastSharedFolder( string $file, - string $publicWebDAVAPIVersion, TableNode $properties ) { $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); @@ -862,92 +860,6 @@ class WebDavLockingContext implements Context { $this->featureContext->setLastUploadDeleteTime(\time()); } - /** - * @When /^the public uploads file "([^"]*)" with content "([^"]*)" sending the locktoken of file "([^"]*)" of user "([^"]*)" using the (old|new) public WebDAV API$/ - * - * @param string $filename - * @param string $content - * @param string $itemToUseLockOf - * @param string $lockOwner - * @param string $publicWebDAVAPIVersion - * - * @return void - * - */ - public function publicUploadFileSendingLockTokenOfUser( - string $filename, - string $content, - string $itemToUseLockOf, - string $lockOwner, - string $publicWebDAVAPIVersion - ) { - $response = $this->publicUploadWithUserLockToken( - $filename, - $content, - $itemToUseLockOf, - $lockOwner, - $publicWebDAVAPIVersion - ); - $this->featureContext->setResponse($response); - } - - /** - * @param string $filename - * @param string $content - * @param string $itemToUseLockOf - * @param string $lockOwner - * @param string $publicWebDAVAPIVersion - * - * @return ResponseInterface - */ - public function publicUploadWithUserLockToken( - string $filename, - string $content, - string $itemToUseLockOf, - string $lockOwner, - string $publicWebDAVAPIVersion - ): ResponseInterface { - $lockOwner = $this->featureContext->getActualUsername($lockOwner); - $headers = [ - "If" => "(<" . $this->tokenOfLastLock[$lockOwner][$itemToUseLockOf] . ">)" - ]; - return $this->publicWebDavContext->publicUploadContent( - $filename, - '', - $content, - false, - $headers, - $publicWebDAVAPIVersion - ); - } - - /** - * @When /^the public uploads file "([^"]*)" with content "([^"]*)" sending the locktoken of "([^"]*)" of the public using the (old|new) public WebDAV API$/ - * - * @param string $filename - * @param string $content - * @param string $itemToUseLockOf - * @param string $publicWebDAVAPIVersion - * - * @return void - */ - public function publicUploadFileSendingLockTokenOfPublic( - string $filename, - string $content, - string $itemToUseLockOf, - string $publicWebDAVAPIVersion - ) { - $lockOwner = $this->featureContext->getLastCreatedPublicShareToken(); - $response = $this->publicUploadWithUserLockToken( - $filename, - $content, - $itemToUseLockOf, - $lockOwner, - $publicWebDAVAPIVersion - ); - $this->featureContext->setResponse($response); - } - /** * @Then :count locks should be reported for file :file of user :user by the WebDAV API * diff --git a/tests/acceptance/features/apiAntivirus/antivirus.feature b/tests/acceptance/features/apiAntivirus/antivirus.feature index 8e4f8de48..f8ff339e1 100644 --- a/tests/acceptance/features/apiAntivirus/antivirus.feature +++ b/tests/acceptance/features/apiAntivirus/antivirus.feature @@ -103,7 +103,7 @@ Feature: antivirus | space | Personal | | permissionsRole | edit | | expirationDateTime | 2040-01-01T23:59:59.000Z | - When the public uploads file "filesForUpload/filesWithVirus/" to "" inside last link shared folder using the new WebDAV API + When the public uploads file "filesForUpload/filesWithVirus/" to "" inside last link shared folder using the public WebDAV API Then the HTTP status code should be "201" And user "Alice" should get a notification with subject "Virus found" and message: | message | @@ -129,7 +129,7 @@ Feature: antivirus | permissionsRole | edit | | password | %public% | | expirationDateTime | 2040-01-01T23:59:59.000Z | - When the public uploads file "filesForUpload/filesWithVirus/" to "" inside last link shared folder with password "%public%" using the new WebDAV API + When the public uploads file "filesForUpload/filesWithVirus/" to "" inside last link shared folder with password "%public%" using the public WebDAV API Then the HTTP status code should be "201" And user "Alice" should get a notification with subject "Virus found" and message: | message | @@ -391,7 +391,7 @@ Feature: antivirus | resource | test.txt | | space | Personal | | permissionsRole | edit | - When the public overwrites file "test.txt" with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" using the new WebDAV API + When the public overwrites file "test.txt" with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" using the public WebDAV API Then the HTTP status code should be "204" And user "Alice" should get a notification with subject "Virus found" and message: | message | diff --git a/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature b/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature index fc1a13d61..38bbbb798 100644 --- a/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature +++ b/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature @@ -71,9 +71,9 @@ Feature: enforce password on public link Then the HTTP status code should be "200" And the OCS status code should be "" And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "%public%" + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" + But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "%public%" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -99,9 +99,9 @@ Feature: enforce password on public link Then the HTTP status code should be "200" And the OCS status code should be "" And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "3s:5WW9uE5h=A" + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" + But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "3s:5WW9uE5h=A" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -163,9 +163,9 @@ Feature: enforce password on public link Then the HTTP status code should be "200" And the OCS status code should be "" And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "6a0Q;A3 +i^m[" + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" + But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "6a0Q;A3 +i^m[" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -221,9 +221,9 @@ Feature: enforce password on public link Then the HTTP status code should be "200" And the OCS status code should be "200" And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "" + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password + And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" + But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "" Examples: | config | config-value | password | | OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 4 | Ps-1 | diff --git a/tests/acceptance/features/apiLocks/lockFiles.feature b/tests/acceptance/features/apiLocks/lockFiles.feature index 3d3c04704..30c92ce9f 100644 --- a/tests/acceptance/features/apiLocks/lockFiles.feature +++ b/tests/acceptance/features/apiLocks/lockFiles.feature @@ -477,7 +477,7 @@ Feature: lock files | space | Personal | | permissionsRole | edit | | password | %public% | - When the public locks "textfile0.txt" in the last public link shared folder using the new public WebDAV API setting the following properties + When the public locks "textfile0.txt" in the last public link shared folder using the public WebDAV API setting the following properties | lockscope | | Then the HTTP status code should be "200" And 1 locks should be reported for file "PARENT/textfile0.txt" of user "Alice" by the WebDAV API @@ -500,7 +500,7 @@ Feature: lock files | space | Personal | | permissionsRole | view | | password | %public% | - When the public tries to lock "textfile0.txt" in the last public link shared folder using the new public WebDAV API setting the following properties + When the public tries to lock "textfile0.txt" in the last public link shared folder using the public WebDAV API setting the following properties | lockscope | | Then the HTTP status code should be "403" And 0 locks should be reported for file "PARENT/textfile0.txt" of user "Alice" by the WebDAV API diff --git a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature index 4166c4339..c55f9f6b2 100644 --- a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature +++ b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature @@ -44,7 +44,7 @@ Feature: A manager of the space can edit public link | share_type | public_link | | displayname_owner | %displayname% | | name | | - When the public downloads file "/test.txt" from inside the last public link shared folder with password "" using the new public WebDAV API + When the public downloads file "/test.txt" from inside the last public link shared folder with password "" using the public WebDAV API Then the HTTP status code should be "200" And the downloaded content should be "some content" Examples: diff --git a/tests/acceptance/features/apiSpaces/publicLink.feature b/tests/acceptance/features/apiSpaces/publicLink.feature index a4a462608..529d2d992 100644 --- a/tests/acceptance/features/apiSpaces/publicLink.feature +++ b/tests/acceptance/features/apiSpaces/publicLink.feature @@ -16,28 +16,28 @@ Feature: public link for a space @issue-10331 Scenario: public tries to upload a file in the public space - When the public uploads file "test.txt" with content "test" using the new public WebDAV API + When the public uploads file "test.txt" with content "test" using the public WebDAV API And the HTTP status code should be "403" @issue-10331 Scenario: public tries to create a folder in the public space - When the public creates folder "created-by-public" using the new public WebDAV API + When the public creates folder "created-by-public" using the public WebDAV API And the HTTP status code should be "403" @issue-10331 Scenario: public tries to delete a file in the public space Given user "Alice" has uploaded a file inside space "public space" with content "some content" to "test.txt" - When the public deletes file "test.txt" from the last public link share using the new public WebDAV API + When the public deletes file "test.txt" from the last public link share using the public WebDAV API And the HTTP status code should be "403" @issue-10331 Scenario: public tries to delete a folder in the public space And user "Alice" has created a folder "/public-folder" in space "public space" - When the public deletes folder "public-folder" from the last public link share using the new public WebDAV API + When the public deletes folder "public-folder" from the last public link share using the public WebDAV API And the HTTP status code should be "403" @issue-10331 Scenario: public tries to change content of a resources in the public space Given user "Alice" has uploaded a file inside space "public space" with content "some content" to "test.txt" - When the public overwrites file "test.txt" with content "public content" using the new WebDAV API + When the public overwrites file "test.txt" with content "public content" using the public WebDAV API And the HTTP status code should be "403" diff --git a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature index 4eed4ce4a..0277968dd 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature @@ -36,10 +36,10 @@ Feature: Share spaces via link | displayname_owner | %displayname% | | uid_owner | %username% | | name | | - When the public downloads file "/test.txt" from inside the last public link shared folder with password "" using the new public WebDAV API + When the public downloads file "/test.txt" from inside the last public link shared folder with password "" using the public WebDAV API Then the HTTP status code should be "200" And the downloaded content should be "some content" - But the public should not be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass" + But the public should not be able to download file "/test.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" Examples: | permissions | expected-permissions | password | link-name | expire-date | | 1 | read | %public% | link | 2042-03-25T23:59:59+0100 | @@ -77,7 +77,7 @@ Feature: Share spaces via link | displayname_owner | %displayname% | | uid_owner | %username% | | name | forUpload | - And the public should be able to upload file "lorem.txt" into the last public link shared folder using the new public WebDAV API with password "%public%" + And the public should be able to upload file "lorem.txt" into the last public link shared folder using the public WebDAV API with password "%public%" And for user "Alice" the space "share space" should contain these entries: | lorem.txt | diff --git a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature index 0247eae03..66bc6ffaa 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature @@ -142,8 +142,8 @@ Feature: Share a file or folder that is inside a space via public link | displayname_owner | %displayname% | | uid_file_owner | %username% | | uid_owner | %username% | - And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "Random data" - And the public upload to the last publicly shared file using the new public WebDAV API with password "%public%" should pass with HTTP status code "204" + And the public should be able to download the last publicly shared file using the public WebDAV API with password "%public%" and the content should be "Random data" + And the public upload to the last publicly shared file using the public WebDAV API with password "%public%" should pass with HTTP status code "204" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | diff --git a/tests/acceptance/features/coreApiSharePublicLink1/accessToPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink1/accessToPublicLinkShare.feature index fb08fad9c..3541cfb42 100644 --- a/tests/acceptance/features/coreApiSharePublicLink1/accessToPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink1/accessToPublicLinkShare.feature @@ -77,5 +77,5 @@ Feature: accessing a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When user "Alice" tries to download file "textfile.txt" from the last public link using own basic auth and new public WebDAV API + When user "Alice" tries to download file "textfile.txt" from the last public link using own basic auth and public WebDAV API Then the HTTP status code should be "401" diff --git a/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature index 9978487a5..387db5abf 100644 --- a/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature @@ -37,7 +37,7 @@ Feature: changing a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "%public%" and the new public WebDAV API + When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "%public%" and the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/parent.txt" should not exist And as "Alice" file "/PARENT/newparent.txt" should exist @@ -50,7 +50,7 @@ Feature: changing a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When the public uploads file "lorem.txt" with password "%public%" and content "test" using the new public WebDAV API + When the public uploads file "lorem.txt" with password "%public%" and content "test" using the public WebDAV API Then the HTTP status code should be "201" And the content of file "PARENT/lorem.txt" for user "Alice" should be "test" @@ -86,7 +86,7 @@ Feature: changing a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "invalid" and the new public WebDAV API + When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "invalid" and the public WebDAV API Then the HTTP status code should be "401" And as "Alice" file "/PARENT/newparent.txt" should not exist And as "Alice" file "/PARENT/parent.txt" should exist @@ -99,7 +99,7 @@ Feature: changing a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "%public%" and the new public WebDAV API + When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "%public%" and the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/newparent.txt" should exist And as "Alice" file "/PARENT/parent.txt" should not exist @@ -112,7 +112,7 @@ Feature: changing a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When the public uploads file "lorem.txt" with password "invalid" and content "test" using the new public WebDAV API + When the public uploads file "lorem.txt" with password "invalid" and content "test" using the public WebDAV API Then the HTTP status code should be "401" And as "Alice" file "/PARENT/lorem.txt" should not exist @@ -124,7 +124,7 @@ Feature: changing a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When the public uploads file "lorem.txt" with password "%public%" and content "test" using the new public WebDAV API + When the public uploads file "lorem.txt" with password "%public%" and content "test" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/lorem.txt" should exist @@ -136,7 +136,7 @@ Feature: changing a public link share | space | Personal | | permissionsRole | createOnly | | password | %public% | - When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "%public%" and the new public WebDAV API + When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "%public%" and the public WebDAV API Then the HTTP status code should be "403" And as "Alice" file "/PARENT/parent.txt" should exist And as "Alice" file "/PARENT/newparent.txt" should not exist @@ -213,7 +213,7 @@ Feature: changing a public link share | password | | Then the HTTP status code should be "200" And the OCS status code should be "" - And the public should be able to download file "/parent.txt" from inside the last public link shared folder using the new public WebDAV API with password "" + And the public should be able to download file "/parent.txt" from inside the last public link shared folder using the public WebDAV API with password "" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | diff --git a/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature index 286d2f56c..a012b83d8 100644 --- a/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature @@ -27,7 +27,7 @@ Feature: create a public link share | 2 | 400 | @smokeTest @issue-10331 @issue-9724 - Scenario Outline: creating a new public link share of a file with password using the new public WebDAV API + Scenario Outline: creating a new public link share of a file with password using the public WebDAV API Given using OCS API version "" And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt" When user "Alice" creates a public link share using the sharing API with settings @@ -47,11 +47,11 @@ Feature: create a public link share | uid_file_owner | %username% | | uid_owner | %username% | | name | | - And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "Random data" - When the public tries to download the last public link shared file with password "%regular%" using the new public WebDAV API + And the public should be able to download the last publicly shared file using the public WebDAV API with password "%public%" and the content should be "Random data" + When the public tries to download the last public link shared file with password "%regular%" using the public WebDAV API Then the HTTP status code should be "401" And the value of the item "//s:message" in the response should match "/Username or password was incorrect/" - When the public tries to download the last public link shared file using the new public WebDAV API + When the public tries to download the last public link shared file using the public WebDAV API Then the HTTP status code should be "401" And the value of the item "//s:message" in the response should match "/No 'Authorization: Basic' header found/" Examples: @@ -81,8 +81,8 @@ Feature: create a public link share | uid_file_owner | %username% | | uid_owner | %username% | | name | | - And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "Random data" - And uploading content to a public link shared file with password "%public%" should work using the new public WebDAV API + And the public should be able to download the last publicly shared file using the public WebDAV API with password "%public%" and the content should be "Random data" + And uploading content to a public link shared file with password "%public%" should work using the public WebDAV API Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -111,12 +111,12 @@ Feature: create a public link share | uid_file_owner | %username% | | uid_owner | %username% | | name | | - And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the old public WebDAV API with password "%public%" and the content should be "Random data" - And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "%public%" and the content should be "Random data" - But the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the old public WebDAV API without a password - And the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the old public WebDAV API with password "%regular%" - And the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the new public WebDAV API without a password - And the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "%regular%" + And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the public WebDAV API with password "%public%" and the content should be "Random data" + And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the public WebDAV API with password "%public%" and the content should be "Random data" + But the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the public WebDAV API without a password + And the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the public WebDAV API with password "%regular%" + And the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the public WebDAV API without a password + And the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the public WebDAV API with password "%regular%" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -182,8 +182,8 @@ Feature: create a public link share | id | A_STRING | | share_type | public_link | | permissions | read | - And the public upload to the last publicly shared folder using the old public WebDAV API with password "%public%" should fail with HTTP status code "403" - And the public upload to the last publicly shared folder using the old public WebDAV API with password "%public%" should fail with HTTP status code "403" + And the public upload to the last publicly shared folder using the public WebDAV API with password "%public%" should fail with HTTP status code "403" + And the public upload to the last publicly shared folder using the public WebDAV API with password "%public%" should fail with HTTP status code "403" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -203,7 +203,7 @@ Feature: create a public link share | id | A_STRING | | share_type | public_link | | permissions | read,update,create,delete | - And uploading a file with password "%public%" should work using the new public WebDAV API + And uploading a file with password "%public%" should work using the public WebDAV API Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -223,7 +223,7 @@ Feature: create a public link share | id | A_STRING | | share_type | public_link | | permissions | read,create | - And uploading a file with password "%public%" should work using the new public WebDAV API + And uploading a file with password "%public%" should work using the public WebDAV API Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -251,7 +251,7 @@ Feature: create a public link share | password | %public% | Then the OCS status code should be "" And the HTTP status code should be "200" - And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "long file" + And the public should be able to download the last publicly shared file using the public WebDAV API with password "%public%" and the content should be "long file" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -267,7 +267,7 @@ Feature: create a public link share | password | %public% | Then the OCS status code should be "" And the HTTP status code should be "200" - And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "%public%" and the content should be "Random data" + And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the public WebDAV API with password "%public%" and the content should be "Random data" Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | @@ -284,7 +284,7 @@ Feature: create a public link share | permissionsRole | view | | password | %public% | When user "Alice" deletes folder "/PARENT" using the WebDAV API - And the public tries to download file "/parent.txt" from inside the last public link shared folder with password "%public%" using the new public WebDAV API + And the public tries to download file "/parent.txt" from inside the last public link shared folder with password "%public%" using the public WebDAV API Then the HTTP status code should be "404" @issue-1269 @issue-1293 @skipOnReva @issue-10331 @issue-9724 @@ -297,7 +297,7 @@ Feature: create a public link share | space | Personal | | permissionsRole | createOnly | | password | %public% | - When the public tries to download file "/parent.txt" from inside the last public link shared folder with password "%public%" using the new public WebDAV API + When the public tries to download file "/parent.txt" from inside the last public link shared folder with password "%public%" using the public WebDAV API Then the HTTP status code should be "403" @env-config @skipOnReva @issue-10331 @issue-10071 @@ -353,21 +353,21 @@ Feature: create a public link share | resource | testFolder | | space | Personal | | permissionsRole | edit | - When the public uploads file "file.txt" to the last public link shared folder with password "%public%" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API + When the public uploads file "file.txt" to the last public link shared folder with password "%public%" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "testFolder/file.txt" should exist And as "Alice" the mtime of the file "testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT" And the mtime of file "file.txt" in the last shared public link using the WebDAV API should be "Thu, 08 Aug 2019 04:18:13 GMT" @env-config @issue-10331 @issue-10071 - Scenario: overwriting a file changes its mtime (new public webDAV API) + Scenario: overwriting a file changes its mtime (public webDAV API) Given the config "OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD" has been set to "false" And user "Alice" has created folder "testFolder" When user "Alice" uploads file with content "uploaded content for file name ending with a dot" to "testFolder/file.txt" using the WebDAV API And user "Alice" creates a public link share using the sharing API with settings | path | /testFolder | | permissions | read,update,create,delete | - And the public uploads file "file.txt" to the last public link shared folder with password "%public%" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API + And the public uploads file "file.txt" to the last public link shared folder with password "%public%" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the public WebDAV API Then the HTTP status code should be "204" And as "Alice" file "/testFolder/file.txt" should exist And as "Alice" the mtime of the file "testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT" diff --git a/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature b/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature index 89869047f..2cef32f5d 100644 --- a/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature +++ b/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature @@ -10,14 +10,14 @@ Feature: copying from public link share And the config "OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD" has been set to "false" @issue-10331 - Scenario: copy file within a public link folder new public WebDAV API + Scenario: copy file within a public link folder Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" And using SharingNG And user "Alice" has created the following resource link share: | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/copy1.txt" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/copy1.txt" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist And as "Alice" file "/PARENT/copy1.txt" should exist @@ -25,7 +25,7 @@ Feature: copying from public link share And the content of file "/PARENT/copy1.txt" for user "Alice" should be "some data" @issue-10331 - Scenario: copy folder within a public link folder new public WebDAV API + Scenario: copy folder within a public link folder Given user "Alice" has created folder "/PARENT/testFolder" And user "Alice" has uploaded file with content "some data" to "/PARENT/testFolder/testfile.txt" And using SharingNG @@ -33,7 +33,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies folder "/testFolder" to "/testFolder-copy" using the new public WebDAV API + When the public copies folder "/testFolder" to "/testFolder-copy" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" folder "/PARENT/testFolder" should exist And as "Alice" folder "/PARENT/testFolder-copy" should exist @@ -49,7 +49,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/testFolder/copy1.txt" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/testFolder/copy1.txt" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist And as "Alice" file "/PARENT/testFolder/copy1.txt" should exist @@ -65,7 +65,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/copy1.txt" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/copy1.txt" using the public WebDAV API Then the HTTP status code should be "204" And as "Alice" file "/PARENT/testfile.txt" should exist And as "Alice" file "/PARENT/copy1.txt" should exist @@ -81,7 +81,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies folder "/testFolder" to "/copy1.txt" using the new public WebDAV API + When the public copies folder "/testFolder" to "/copy1.txt" using the public WebDAV API Then the HTTP status code should be "204" And as "Alice" folder "/PARENT/testFolder" should exist And the content of file "/PARENT/copy1.txt/testfile.txt" for user "Alice" should be "some data" @@ -96,7 +96,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/copy1.txt" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/copy1.txt" using the public WebDAV API And user "Alice" deletes file "/PARENT/copy1.txt" using the WebDAV API Then the HTTP status code should be "204" And as "Alice" file "/PARENT/copy1.txt" should not exist @@ -111,7 +111,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/new-folder" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/new-folder" using the public WebDAV API Then the HTTP status code should be "204" And the content of file "/PARENT/testfile.txt" for user "Alice" should be "some data" And the content of file "/PARENT/new-folder" for user "Alice" should be "some data" @@ -126,7 +126,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/" to "/copy1.txt" using the new public WebDAV API + When the public copies file "/" to "/copy1.txt" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/" should exist And as "Alice" file "/PARENT/copy1.txt" should exist @@ -147,7 +147,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist And as "Alice" file "/PARENT/" should exist @@ -169,7 +169,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "//copy1.txt" using the new public WebDAV API + When the public copies file "/testfile.txt" to "//copy1.txt" using the public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist And as "Alice" file "/PARENT//copy1.txt" should exist @@ -190,7 +190,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/testfile.txt" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/testfile.txt" using the public WebDAV API Then the HTTP status code should be "204" And the content of file "/PARENT/testfile.txt" for user "Alice" should be "some data" @@ -203,7 +203,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies folder "/testFolder" to "/testFolder" using the new public WebDAV API + When the public copies folder "/testFolder" to "/testFolder" using the public WebDAV API Then the HTTP status code should be "204" And as "Alice" folder "/PARENT/testFolder" should exist And the content of file "/PARENT/testFolder/testfile.txt" for user "Alice" should be "some data" @@ -216,7 +216,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies file "/testfile.txt" to "/" using the new public WebDAV API + When the public copies file "/testfile.txt" to "/" using the public WebDAV API Then the HTTP status code should be "409" And as "Alice" file "/PARENT/testfile.txt" should exist And the content of file "/PARENT/testfile.txt" for user "Alice" should be "some data" @@ -230,7 +230,7 @@ Feature: copying from public link share | resource | PARENT | | space | Personal | | permissionsRole | edit | - When the public copies folder "/testFolder" to "/" using the new public WebDAV API + When the public copies folder "/testFolder" to "/" using the public WebDAV API Then the HTTP status code should be "409" And as "Alice" folder "/PARENT/testFolder" should exist And the content of file "/PARENT/testFolder/testfile.txt" for user "Alice" should be "some data" diff --git a/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature index 494929dc4..2c9752606 100644 --- a/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature @@ -19,7 +19,7 @@ Feature: upload to a public link share | permissionsRole | createOnly | | password | %public% | And user "Alice" has deleted folder "/FOLDER" - When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test-file" using the public WebDAV API And the HTTP status code should be "404" @issue-1268 @@ -37,7 +37,7 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | view | | password | %public% | - When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test-file" using the public WebDAV API And the HTTP status code should be "403" @issue-10331 @@ -48,7 +48,7 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | createOnly | | password | %public% | - When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test-file" using the public WebDAV API Then the HTTP status code should be "201" And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file" And the following headers should match these regular expressions @@ -62,7 +62,7 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | createOnly | | password | %public% | - When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test-file" using the public WebDAV API Then the HTTP status code should be "201" And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file" @@ -74,7 +74,7 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test-file" using the public WebDAV API Then the HTTP status code should be "201" And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file" @@ -87,7 +87,7 @@ Feature: upload to a public link share | permissionsRole | edit | | password | %public% | And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" - When the public uploads file "test.txt" with password "%public%" and content "test2" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API Then the HTTP status code should be "507" @skipOnReva @issue-10331 @@ -99,7 +99,7 @@ Feature: upload to a public link share | permissionsRole | createOnly | | password | %public% | And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" - When the public uploads file "test.txt" with password "%public%" and content "test2" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API Then the HTTP status code should be "507" @smokeTest @issue-10331 @@ -110,7 +110,7 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | createOnly | | password | %public% | - When the public uploads file "test.txt" with password "%public%" and content "test2" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API Then the HTTP status code should be "201" And the content of file "/FOLDER/test.txt" for user "Alice" should be "test2" @@ -122,11 +122,11 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | createOnly | | password | %public% | - When the public uploads file "test.txt" with password "%public%" and content "test" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test" using the public WebDAV API Then the HTTP status code should be "201" And the following headers should match these regular expressions | ETag | /^"[a-f0-9:\.]{1,32}"$/ | - When the public uploads file "test.txt" with password "%public%" and content "test2" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API Then the HTTP status code should be "201" And the content of file "/FOLDER/test.txt" for user "Alice" should be "test" And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2" diff --git a/tests/acceptance/features/coreApiWebdavEtagPropagation1/moveFileFolder.feature b/tests/acceptance/features/coreApiWebdavEtagPropagation1/moveFileFolder.feature index 009f286f2..2f862bfcc 100644 --- a/tests/acceptance/features/coreApiWebdavEtagPropagation1/moveFileFolder.feature +++ b/tests/acceptance/features/coreApiWebdavEtagPropagation1/moveFileFolder.feature @@ -297,7 +297,7 @@ Feature: propagation of etags when moving files or folders | password | %public% | And user "Alice" has stored etag of element "/" And user "Alice" has stored etag of element "/upload" - When the public renames file "file.txt" to "renamed.txt" from the last public link share using the password "%public%" and the new public WebDAV API + When the public renames file "file.txt" to "renamed.txt" from the last public link share using the password "%public%" and the public WebDAV API Then the HTTP status code should be "201" And these etags should have changed: | user | path | @@ -322,7 +322,7 @@ Feature: propagation of etags when moving files or folders | password | %public% | And user "Alice" has stored etag of element "/" And user "Alice" has stored etag of element "/upload" - When the public renames folder "sub" to "renamed" from the last public link share using the password "%public%" and the new public WebDAV API + When the public renames folder "sub" to "renamed" from the last public link share using the password "%public%" and the public WebDAV API Then the HTTP status code should be "201" And these etags should have changed: | user | path | diff --git a/tests/acceptance/features/coreApiWebdavEtagPropagation2/copyFileFolder.feature b/tests/acceptance/features/coreApiWebdavEtagPropagation2/copyFileFolder.feature index bc615479f..d9f4e20b7 100644 --- a/tests/acceptance/features/coreApiWebdavEtagPropagation2/copyFileFolder.feature +++ b/tests/acceptance/features/coreApiWebdavEtagPropagation2/copyFileFolder.feature @@ -119,7 +119,7 @@ Feature: propagation of etags when copying files or folders And user "Alice" has stored etag of element "/upload" And user "Alice" has stored etag of element "/upload/file.txt" And user "Alice" has stored etag of element "/upload/file.txt" on path "/upload/renamedFile.txt" - When the public copies file "file.txt" to "/renamedFile.txt" using the new public WebDAV API + When the public copies file "file.txt" to "/renamedFile.txt" using the public WebDAV API Then the HTTP status code should be "201" And these etags should have changed: | user | path | diff --git a/tests/acceptance/features/coreApiWebdavEtagPropagation2/createFolder.feature b/tests/acceptance/features/coreApiWebdavEtagPropagation2/createFolder.feature index 4f609c438..e12aed400 100644 --- a/tests/acceptance/features/coreApiWebdavEtagPropagation2/createFolder.feature +++ b/tests/acceptance/features/coreApiWebdavEtagPropagation2/createFolder.feature @@ -118,7 +118,7 @@ Feature: propagation of etags when creating folders | permissionsRole | createOnly | And user "Alice" has stored etag of element "/" And user "Alice" has stored etag of element "/folder" - When the public creates folder "created-by-public" using the new public WebDAV API + When the public creates folder "created-by-public" using the public WebDAV API Then the HTTP status code should be "201" And these etags should have changed: | user | path | diff --git a/tests/acceptance/features/coreApiWebdavEtagPropagation2/upload.feature b/tests/acceptance/features/coreApiWebdavEtagPropagation2/upload.feature index 3f9f95892..e823738b8 100644 --- a/tests/acceptance/features/coreApiWebdavEtagPropagation2/upload.feature +++ b/tests/acceptance/features/coreApiWebdavEtagPropagation2/upload.feature @@ -177,7 +177,7 @@ Feature: propagation of etags when uploading data | password | %public% | And user "Alice" has stored etag of element "/" And user "Alice" has stored etag of element "/upload" - When the public uploads file "file.txt" with password "%public%" and content "new content" using the new public WebDAV API + When the public uploads file "file.txt" with password "%public%" and content "new content" using the public WebDAV API Then the HTTP status code should be "201" And these etags should have changed: | user | path | diff --git a/tests/acceptance/features/coreApiWebdavOperations/propfind.feature b/tests/acceptance/features/coreApiWebdavOperations/propfind.feature index 5f9b7c84a..95a46677b 100644 --- a/tests/acceptance/features/coreApiWebdavOperations/propfind.feature +++ b/tests/acceptance/features/coreApiWebdavOperations/propfind.feature @@ -46,7 +46,7 @@ Feature: PROPFIND | space | Personal | | permissionsRole | view | | password | %public% | - When the public sends "PROPFIND" request to the last public link share using the new public WebDAV API with password "%public%" + When the public sends "PROPFIND" request to the last public link share using the public WebDAV API with password "%public%" Then the HTTP status code should be "207" And the value of the item "//d:href" in the response should match "/\/dav\/public-files\/%public_token%\/$/" And the value of the item "//oc:public-link-share-owner" in the response should be "Alice" @@ -61,7 +61,7 @@ Feature: PROPFIND | space | Personal | | permissionsRole | view | | password | %public% | - When the public sends "PROPFIND" request to the last public link share using the new public WebDAV API + When the public sends "PROPFIND" request to the last public link share using the public WebDAV API Then the HTTP status code should be "401" And the value of the item "/d:error/s:exception" in the response should be "Sabre\DAV\Exception\NotAuthenticated" @@ -75,6 +75,6 @@ Feature: PROPFIND | space | Personal | | permissionsRole | view | | password | %public% | - When the public sends "PROPFIND" request to the last public link share using the new public WebDAV API with password "1234" + When the public sends "PROPFIND" request to the last public link share using the public WebDAV API with password "1234" Then the HTTP status code should be "401" And the value of the item "/d:error/s:exception" in the response should be "Sabre\DAV\Exception\NotAuthenticated" diff --git a/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature b/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature index 695b0ccc6..86aecfa25 100644 --- a/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature +++ b/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature @@ -382,6 +382,6 @@ Feature: upload file | space | new-space | | permissionsRole | edit | | password | %public% | - When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API + When the public uploads file "test.txt" with password "%public%" and content "test-file" using the public WebDAV API Then the HTTP status code should be "201" - And for user "Alice" the content of the file "/test.txt" of the space "new-space" should be "test-file" \ No newline at end of file + And for user "Alice" the content of the file "/test.txt" of the space "new-space" should be "test-file"