X Tutup
Skip to content

Commit 63034a6

Browse files
committed
User, password and resouce names removed for getting the size of the public link
1 parent f79e5cf commit 63034a6

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,6 @@ Feature: create a public link share
512512
And user "user0" has created a public link share with settings
513513
| path | test-file.txt |
514514
| permissions | read |
515-
When user "user0" gets size of file "test-file.txt" shared by public link using the WebDAV API
515+
When the public gets the size of the last shared public link using the WebDAV API
516516
Then the HTTP status code should be "207"
517517
And the size of the file should be "19"

tests/acceptance/features/apiWebdavOperations/downloadFile.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ Feature: download file
8282

8383
Scenario: Get the size of a file
8484
Given user "user0" has uploaded file with content "This is a test file" to "test-file.txt"
85-
When user "user0" gets size of file "test-file.txt" using the WebDAV API
85+
When user "user0" gets the size of file "test-file.txt" using the WebDAV API
8686
Then the HTTP status code should be "207"
8787
And the size of the file should be "19"

tests/acceptance/features/bootstrap/WebDav.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,27 +1100,22 @@ public function downloadFileAsUserUsingPassword(
11001100
}
11011101

11021102
/**
1103-
* @When user :user gets size of file :resource shared by public link using the WebDAV API
1104-
*
1105-
* @param $user
1106-
* @param $resource
1103+
* @When the public gets the size of the last shared public link using the WebDAV API
11071104
*
11081105
* @return void
11091106
* @throws Exception
11101107
*/
1111-
public function userGetsSizeOfFileSharedByPublicLinkUsingTheWebdavApi($user, $resource) {
1108+
public function publicGetsSizeOfLastSharedPublicLinkUsingTheWebdavApi() {
11121109
$tokenArray = $this->getLastShareData()->data->token;
11131110
$token = (string)$tokenArray[0];
1114-
$headers = $this->guzzleClientHeaders;
1115-
$password = $this->getPasswordForUser($user);
11161111
$url = $this->getBaseUrl() . "/remote.php/dav/public-files/{$token}";
11171112
$this->response = HttpRequestHelper::sendRequest(
1118-
$url, "PROPFIND", $user, $password, $headers, null, null, null
1113+
$url, "PROPFIND", null, null, null
11191114
);
11201115
}
11211116

11221117
/**
1123-
* @When user :user gets size of file :resource using the WebDAV API
1118+
* @When user :user gets the size of file :resource using the WebDAV API
11241119
*
11251120
* @param $user
11261121
* @param $resource
@@ -1148,7 +1143,7 @@ public function theSizeOfTheFileShouldBe($size) {
11481143
$responseXml = HttpRequestHelper::getResponseXml($this->response);
11491144
$responseXml->registerXPathNamespace('d', 'DAV:');
11501145
$xmlPart = $responseXml->xpath("//d:prop/d:getcontentlength");
1151-
Assert::assertEquals($size, (string)$xmlPart[0]);
1146+
Assert::assertEquals($size, (string) $xmlPart[0]);
11521147
}
11531148

11541149
/**

0 commit comments

Comments
 (0)
X Tutup