diff --git a/tests/integration/features/bootstrap/BasicStructure.php b/tests/integration/features/bootstrap/BasicStructure.php index 96d08e2ac3e3..9d4d0a031c5d 100644 --- a/tests/integration/features/bootstrap/BasicStructure.php +++ b/tests/integration/features/bootstrap/BasicStructure.php @@ -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 diff --git a/tests/integration/features/bootstrap/WebDav.php b/tests/integration/features/bootstrap/WebDav.php index 7583465353a6..10c67dda5d63 100644 --- a/tests/integration/features/bootstrap/WebDav.php +++ b/tests/integration/features/bootstrap/WebDav.php @@ -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)'); } diff --git a/tests/integration/features/external-storage.feature b/tests/integration/features/external-storage.feature index d4599662d057..031a403e1fc3 100644 --- a/tests/integration/features/external-storage.feature +++ b/tests/integration/features/external-storage.feature @@ -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 +