diff options
Diffstat (limited to 'build/integration/features/bootstrap/Sharing.php')
-rw-r--r-- | build/integration/features/bootstrap/Sharing.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index faf8e0bf507..ec270ef05ce 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -18,17 +18,17 @@ trait Sharing{ private $lastShareData = null; /** - * @When /^creating a share with$/ + * @Given /^as "([^"]*)" creating a share with$/ * @param \Behat\Gherkin\Node\TableNode|null $formData */ - public function creatingShare($body) { + public function asCreatingAShareWith($user, $body) { $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v1/shares"; $client = new Client(); $options = []; - if ($this->currentUser === 'admin') { + if ($user === 'admin') { $options['auth'] = $this->adminUser; } else { - $options['auth'] = [$this->currentUser, $this->regularUser]; + $options['auth'] = [$user, $this->regularUser]; } if ($body instanceof \Behat\Gherkin\Node\TableNode) { @@ -50,6 +50,14 @@ trait Sharing{ } /** + * @When /^creating a share with$/ + * @param \Behat\Gherkin\Node\TableNode|null $formData + */ + public function creatingShare($body) { + return $this->asCreatingAShareWith($this->currentUser, $body); + } + + /** * @Then /^Public shared file "([^"]*)" can be downloaded$/ */ public function checkPublicSharedFile($filename) { |