From 9628806b8f65ada8905d407a512808a5ab34c3f3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 31 Mar 2023 16:27:23 +0200 Subject: [PATCH] fix(CI): Clear the trash between tests Signed-off-by: Joas Schilling --- .../Integration/features/bootstrap/FeatureContext.php | 8 ++++++++ tests/Integration/features/bootstrap/WebDav.php | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/tests/Integration/features/bootstrap/FeatureContext.php b/tests/Integration/features/bootstrap/FeatureContext.php index 37007da9..85dfa9cc 100644 --- a/tests/Integration/features/bootstrap/FeatureContext.php +++ b/tests/Integration/features/bootstrap/FeatureContext.php @@ -82,6 +82,14 @@ public function cleanUpBetweenTests() { $this->userDeletesFile('test1', 'file', '/foobar.txt'); } catch (\Exception $e) { } + try { + $this->userDeletesFile('test1', 'file', '/definitely.notexe'); + } catch (\Exception $e) { + } + try { + $this->emptyTrashbin('test1'); + } catch (\Exception $e) { + } } /** diff --git a/tests/Integration/features/bootstrap/WebDav.php b/tests/Integration/features/bootstrap/WebDav.php index 094163c9..fe018c76 100644 --- a/tests/Integration/features/bootstrap/WebDav.php +++ b/tests/Integration/features/bootstrap/WebDav.php @@ -656,6 +656,16 @@ public function userDeletesFile($user, $type, $file) { } } + /** + * @When User "([^"]*)" empties trashbin + * @param string $user user + */ + public function emptyTrashbin($user) { + $client = $this->getSabreClient($user); + $response = $client->request('DELETE', $this->makeSabrePath($user, 'trash', 'trashbin')); + Assert::assertEquals(204, $response['statusCode']); + } + /** * @Given User :user created a folder :destination * @param string $user