Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/integration/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ trait Sharing {
/** @var int */
private $savedShareId = null;

/** @var int */
private $lastShareTime = null;

/**
* @Given /^as "([^"]*)" creating a share with$/
* @param string $user
Expand Down Expand Up @@ -425,6 +428,14 @@ public function assureFileIsShared($entry, $filepath, $user1, $user2, $withPerms
if ($this->isUserOrGroupInSharedData($user2, $permissions)){
return;
} else {
$time = time();
if ($this->lastShareTime !== null && $time - $this->lastShareTime < 1) {
// prevent creating two shares with the same "stime" which is based on
// seconds, this affects share merging order and could affect expected test
// result order
sleep(1);
}
$this->lastShareTime = $time;
$this->createShare($user1, $filepath, 0, $user2, null, null, $permissions);
}
$this->response = $client->get($fullUrl, $options);
Expand Down