Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/integration/features/bootstrap/BasicStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ public function fileIsCreatedInLocalStorageWithText($filename, $text) {
$this->createFileWithText("local_storage/$filename", $text);
}

/**
* @Given file :filename is deleted in local storage
* @param string $filename
*/
public function fileIsDeletedInLocalStorage($filename) {
unlink("work/local_storage/$filename");
}

/**
* @param string $userName
* @return string
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function theResponseShouldContainACustomPropertyWithValue($propertyName,
*/
public function asTheFileOrFolderDoesNotExist($user, $entry, $path) {
$client = $this->getSabreClient($user);
$response = $client->request('HEAD', $this->makeSabrePath($user, $path));
$response = $client->request('HEAD', $this->makeSabrePath($user, '/' . ltrim($path, '/')));
if ($response['statusCode'] !== 404) {
throw new \Exception($entry . ' "' . $path . '" expected to not exist (status code ' . $response['statusCode'] . ', expected 404)');
}
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/features/external-storage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ Feature: external-storage
And as "user0" the file "/local_storage/foo2/textfile0.txt" does not exist
And as "user1" the file "/local.txt" exists

Scenario: Download a file that exists in filecache but not storage fails with 404
Given user "user0" exists
And As an "user0"
And user "user0" created a folder "/local_storage/foo3"
And User "user0" moved file "/textfile0.txt" to "/local_storage/foo3/textfile0.txt"
And file "foo3/textfile0.txt" is deleted in local storage
When Downloading file "local_storage/foo3/textfile0.txt"
Then the HTTP status code should be "404"
And as "user0" the file "local_storage/foo3/textfile0.txt" does not exist