From 0bc3d8646e84a002619f7eb00ba30dcf4dffbb54 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 30 May 2023 15:03:54 +0545 Subject: [PATCH] Adjust test method tryToDeleteFileFromTrashbin --- tests/acceptance/features/bootstrap/TrashbinContext.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/bootstrap/TrashbinContext.php b/tests/acceptance/features/bootstrap/TrashbinContext.php index d3213d8f5..1eb3310af 100644 --- a/tests/acceptance/features/bootstrap/TrashbinContext.php +++ b/tests/acceptance/features/bootstrap/TrashbinContext.php @@ -586,7 +586,10 @@ class TrashbinContext implements Context { $numItemsDeleted = 0; foreach ($listing as $entry) { - if ($entry['original-location'] === $originalPath) { + // The entry for the trashbin root can have original-location null. + // That is reasonable, because the trashbin root is not something that can be restored. + $originalLocation = $entry['original-location'] ?? ''; + if (\trim($originalLocation, '/') === $originalPath) { $trashItemHRef = $this->convertTrashbinHref($entry['href']); $response = $this->featureContext->makeDavRequest( $asUser,