Skip to content

Commit 0ef18e1

Browse files
committed
Revert "Merge pull request #837 from nextcloud/bugfix/noid/adjust-expected-response-code"
This reverts commit d329e6d, reversing changes made to de09882. Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
1 parent 7503e9a commit 0ef18e1

3 files changed

Lines changed: 10 additions & 38 deletions

File tree

tests/Integration/features/author.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Feature: Author
2828
| checks-0 | {"class":"OCA\\\\WorkflowEngine\\\\Check\\\\FileName","operator":"is","value":"foobar.txt"} |
2929
And as user "test1"
3030
When Downloading file "/foobar.txt"
31-
Then The webdav response should have a status code "403"
31+
Then The webdav response should have a status code "404"
3232
When Downloading file "/foobar.txt" with range "1-4"
33-
Then The webdav response should have a status code "403"
33+
Then The webdav response should have a status code "404"
3434
Then User "test1" sees no files in the trashbin
3535

3636
Scenario: Updating file is blocked

tests/Integration/features/bootstrap/WebDav.php

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,6 @@ public function checkPropForFile($file, $prefix, $prop, $value) {
208208
Assert::assertEquals($value, $property);
209209
}
210210

211-
/**
212-
* @Then /^Propfind for file "([^"]*)" prop "([^"]*):([^"]*)" fails with ([0-9]+) "([^"]*)"$/
213-
*/
214-
public function checkPropForFileFails(string $file, string $prefix, string $prop, int $status, string $message): void {
215-
$this->propfindFileFailed($this->currentUser, $file, "<$prefix:$prop/>");
216-
Assert::assertEquals($status, $this->response['statusCode']);
217-
Assert::assertStringContainsString($message, $this->response['body']);
218-
}
219-
220211
/**
221212
* @Then /^Image search should work$/
222213
*/
@@ -413,10 +404,11 @@ public function listFolder($user, $path, $folderDepth, $properties = null) {
413404
}
414405

415406
/**
416-
* Returns the elements of a propfind command
407+
* Returns the elements of a profind command
417408
* @param string $properties properties which needs to be included in the report
409+
* @param string $filterRules filter-rules to choose what needs to appear in the report
418410
*/
419-
public function propfindFile(string $user, string $path, string $properties = ''): array {
411+
public function propfindFile(string $user, string $path, string $properties = '') {
420412
$client = $this->getSabreClient($user);
421413

422414
$body = '<?xml version="1.0" encoding="utf-8" ?>
@@ -434,26 +426,6 @@ public function propfindFile(string $user, string $path, string $properties = ''
434426
return $parsedResponse;
435427
}
436428

437-
/**
438-
* Returns the elements of a propfind command
439-
* @param string $properties properties which needs to be included in the report
440-
*/
441-
public function propfindFileFailed(string $user, string $path, string $properties = ''): void {
442-
$client = $this->getSabreClient($user);
443-
444-
$body = '<?xml version="1.0" encoding="utf-8" ?>
445-
<d:propfind xmlns:d="DAV:"
446-
xmlns:oc="http://owncloud.org/ns"
447-
xmlns:nc="http://nextcloud.org/ns"
448-
xmlns:ocs="http://open-collaboration-services.org/ns">
449-
<d:prop>
450-
' . $properties . '
451-
</d:prop>
452-
</d:propfind>';
453-
454-
$this->response = $client->request('PROPFIND', $this->makeSabrePath($user, $path), $body);
455-
}
456-
457429
/**
458430
* Returns the elements of a search command
459431
* @param string $properties properties which needs to be included in the report

tests/Integration/features/sharing-user.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Feature: Sharing user
140140
| operation | deny |
141141
| checks-0 | {"class":"OCA\\\\WorkflowEngine\\\\Check\\\\FileSystemTags", "operator": "is", "value": "{{{FILES_ACCESSCONTROL_INTEGRATIONTEST_TAGID}}}"} |
142142
Then Downloading file "/nextcloud2.txt" as "test2"
143-
And The webdav response should have a status code "403"
143+
And The webdav response should have a status code "404"
144144
And Downloading file "/nextcloud3.txt" as "test2"
145145
And The webdav response should have a status code "200"
146146
And user "test2" should see following elements
@@ -169,7 +169,7 @@ Feature: Sharing user
169169
Then Downloading file "/nextcloud2.txt" as "test2"
170170
And The webdav response should have a status code "200"
171171
And Downloading file "/nextcloud3.txt" as "test2"
172-
And The webdav response should have a status code "403"
172+
And The webdav response should have a status code "404"
173173
And user "test2" should see following elements
174174
| /nextcloud2.txt |
175175

@@ -197,10 +197,10 @@ Feature: Sharing user
197197
| operation | deny |
198198
| checks-0 | {"class":"OCA\\\\WorkflowEngine\\\\Check\\\\FileMimeType", "operator": "is", "value": "text/plain"} |
199199
And as user "test2"
200-
When Propfind for file "/foobar.txt" prop "oc:permissions" fails with 403 "<s:message>No read permissions."
200+
When File "/foobar.txt" should have prop "oc:permissions" equal to "SRD"
201201
When Downloading file "/foobar.txt"
202-
Then The webdav response should have a status code "403"
202+
Then The webdav response should have a status code "404"
203203
When Downloading file "/foobar.txt" with range "1-4"
204-
Then The webdav response should have a status code "403"
204+
Then The webdav response should have a status code "404"
205205
When Downloading last public shared file with range "1-4"
206206
Then The webdav response should have a status code "404"

0 commit comments

Comments
 (0)