diff --git a/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature b/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature index ad2cc5ddce56..cc1727db8342 100644 --- a/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature +++ b/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature @@ -271,3 +271,15 @@ Feature: files and folders exist in the trashbin after being deleted | dav-path | | old | | new | + + Scenario Outline: deleted file has appropriate deletion time information + Given using DAV path + And user "Alice" has deleted file "textfile0.txt" + When user "Alice" tries to list the trashbin content for user "Alice" + Then the last webdav response should contain the following elements + | path | mtime | + | /textfile0.txt | deleted_mtime | + Examples: + | dav-path | + | old | + | new | \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/TrashbinContext.php b/tests/acceptance/features/bootstrap/TrashbinContext.php index 542793ef9d8c..8b4453e58e4a 100644 --- a/tests/acceptance/features/bootstrap/TrashbinContext.php +++ b/tests/acceptance/features/bootstrap/TrashbinContext.php @@ -260,13 +260,25 @@ public function theLastWebdavResponseShouldContainFollowingElements(TableNode $e foreach ($elementRows as $expectedElement) { $found = false; $expectedPath = $expectedElement['path']; - foreach ($files as $file) { - if (\ltrim($expectedPath, "/") === \ltrim($file['original-location'], "/")) { - $found = true; - break; + $expectedMtime = $expectedElement['mtime'] === "deleted_mtime" ? $this->featureContext->getLastUploadDeleteTime() : $expectedElement['mtime']; + + if (isset($expectedElement['mtime'])) { + foreach ($files as $file) { + if (\ltrim($expectedPath, "/") === \ltrim($file['original-location'], "/") && \ltrim($expectedMtime, "/") === \ltrim($file['mtime'], "/")) { + $found = true; + break; + } + } + Assert::assertTrue($found, "$expectedPath with mtime $expectedMtime expected to be listed in response but not found"); + } else { + foreach ($files as $file) { + if (\ltrim($expectedPath, "/") === \ltrim($file['original-location'], "/")) { + $found = true; + break; + } } + Assert::assertTrue($found, "$expectedPath expected to be listed in response but not found"); } - Assert::assertTrue($found, "$expectedPath expected to be listed in response but not found"); } } diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index 2655e517374a..36fc338df858 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -104,6 +104,13 @@ public function setLastUploadDeleteTime($lastUploadDeleteTime) { $this->lastUploadDeleteTime = $lastUploadDeleteTime; } + /** + * @return number + */ + public function getLastUploadDeleteTime() { + return $this->lastUploadDeleteTime; + } + /** * @return SimpleXMLElement */