Skip to content

Commit

Permalink
fix(CI): Clear the trash between tests
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed May 10, 2023
1 parent ccb92d6 commit 5bc9f25
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
}
}

/**
Expand Down
10 changes: 10 additions & 0 deletions tests/Integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,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
Expand Down

0 comments on commit 5bc9f25

Please sign in to comment.