Skip to content

Commit

Permalink
Reuse core code
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Sep 5, 2022
1 parent 135c692 commit e76aae7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tests/acceptance/features/apiSpaces/moveSpaces.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @skipOnOcV10
@api @skipOnOcV10 @files_sharing-app-required
Feature: move (rename) file
As a user
I want to be able to move and rename files
Expand Down Expand Up @@ -262,7 +262,7 @@ Feature: move (rename) file
And user "Brian" folder "/folderB/ONE" of the space "Shares Jail" should have the previously stored id


Scenario: Moving a file out of a shared folder as the sharer
Scenario: Moving a file out of a shared folder as a sharer
Given user "Brian" has created folder "/testshare"
And user "Brian" has uploaded file with content "test data" to "/testshare/testfile.txt"
And user "Brian" has created a share with settings
Expand All @@ -280,7 +280,7 @@ Feature: move (rename) file
| /testshare/testfile.txt |


Scenario: Moving a folder out of a shared folder as the sharer
Scenario: Moving a folder out of a shared folder as a sharer
Given user "Brian" has created the following folders
| path |
| /testshare |
Expand Down
39 changes: 34 additions & 5 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ class SpacesContext implements Context {
*/
private string $davSpacesUrl = '/remote.php/dav/spaces/';

/**
* @var string
*/
private string $storedFileID;

/**
* @var array map with user as key, spaces and file etags as value
* @example
Expand Down Expand Up @@ -3235,4 +3230,38 @@ public function userFavoritesElementInSpaceUsingTheWebdavApi(string $user, strin
$this->setSpaceIDByName($user, $spaceName);
$this->favoritesContext->userFavoritesElement($user, $path);
}

/**
* @Given /^user "([^"]*)" has stored id of (file|folder) "([^"]*)" of the space "([^"]*)"$/
*
* @param string $user
* @param string $fileOrFolder
* @param string $path
* @param string $spaceName
*
* @return void
*
* @throws GuzzleException
*/
public function userHasStoredIdOfPathOfTheSpace(string $user, string $fileOrFolder, string $path, string $spaceName): void {
$this->setSpaceIDByName($user, $spaceName);
$this->featureContext->userStoresFileIdForPath($user, $fileOrFolder, $path);
}

/**
* @Then /^user "([^"]*)" (folder|file) "([^"]*)" of the space "([^"]*)" should have the previously stored id$/
*
* @param string|null $user
* @param string $fileOrFolder
* @param string $path
* @param string $spaceName
*
* @return void
*
* @throws GuzzleException
*/
public function userFolderOfTheSpaceShouldHaveThePreviouslyStoredId(?string $user, string $fileOrFolder, string $path, string $spaceName): void {
$this->setSpaceIDByName($user, $spaceName);
$this->featureContext->userFileShouldHaveStoredId($user, $fileOrFolder, $path);
}
}

0 comments on commit e76aae7

Please sign in to comment.