Merge pull request #4535 from owncloud/reuseCodeFavorites
[full-ci][tests-only]Refactor and Reuse code from core
This commit is contained in:
2 files changed
+19
-47
No files matched your search
@@ -15,7 +15,7 @@ Feature: favorite
|
|||||||
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
|
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
|
||||||
When user "Brian" favorites element "/PARENT" in space "Shares Jail" using the WebDAV API
|
When user "Brian" favorites element "/PARENT" in space "Shares Jail" using the WebDAV API
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "207"
|
||||||
And as user "Brian" folder "/PARENT" inside space "Shares Jail" should contain a property "oc:favorite" with value "1"
|
And as user "Brian" folder "/PARENT" inside space "Shares Jail" should be favorited
|
||||||
|
|
||||||
|
|
||||||
Scenario: favorite a file inside of a received share
|
Scenario: favorite a file inside of a received share
|
||||||
@@ -24,7 +24,7 @@ Feature: favorite
|
|||||||
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
|
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
|
||||||
When user "Brian" favorites element "/PARENT/parent.txt" in space "Shares Jail" using the WebDAV API
|
When user "Brian" favorites element "/PARENT/parent.txt" in space "Shares Jail" using the WebDAV API
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "207"
|
||||||
And as user "Brian" file "/PARENT/parent.txt" inside space "Shares Jail" should contain a property "oc:favorite" with value "1"
|
And as user "Brian" file "/PARENT/parent.txt" inside space "Shares Jail" should be favorited
|
||||||
|
|
||||||
|
|
||||||
Scenario: favorite a folder inside of a received share
|
Scenario: favorite a folder inside of a received share
|
||||||
@@ -33,7 +33,7 @@ Feature: favorite
|
|||||||
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
|
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
|
||||||
When user "Brian" favorites element "/PARENT/sub-folder" in space "Shares Jail" using the WebDAV API
|
When user "Brian" favorites element "/PARENT/sub-folder" in space "Shares Jail" using the WebDAV API
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "207"
|
||||||
And as user "Brian" folder "/PARENT/sub-folder" inside space "Shares Jail" should contain a property "oc:favorite" with value "1"
|
And as user "Brian" folder "/PARENT/sub-folder" inside space "Shares Jail" should be favorited
|
||||||
|
|
||||||
|
|
||||||
Scenario: sharee file favorite state should not change the favorite state of sharer
|
Scenario: sharee file favorite state should not change the favorite state of sharer
|
||||||
@@ -42,5 +42,5 @@ Feature: favorite
|
|||||||
And user "Brian" has accepted share "/parent.txt" offered by user "Alice"
|
And user "Brian" has accepted share "/parent.txt" offered by user "Alice"
|
||||||
When user "Brian" favorites element "/parent.txt" in space "Shares Jail" using the WebDAV API
|
When user "Brian" favorites element "/parent.txt" in space "Shares Jail" using the WebDAV API
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "207"
|
||||||
And as user "Brian" file "/parent.txt" inside space "Shares Jail" should contain a property "oc:favorite" with value "1"
|
And as user "Brian" file "/parent.txt" inside space "Shares Jail" should be favorited
|
||||||
And as user "Alice" file "/PARENT/parent.txt" inside space "Personal" should contain a property "oc:favorite" with value "0"
|
And as user "Alice" file "/PARENT/parent.txt" inside space "Personal" should not be favorited
|
||||||
@@ -3192,48 +3192,20 @@ class SpacesContext implements Context {
|
|||||||
$this->featureContext->setResponseXmlObject($responseXml);
|
$this->featureContext->setResponseXmlObject($responseXml);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then /^as user "([^"]*)" (?:file|folder|entry|resource) "([^"]*)" inside space "([^"]*)" should contain a property "([^"]*)" with value "([^"]*)"$/
|
* @Then /^as user "([^"]*)" (?:file|folder|entry) "([^"]*)" inside space "([^"]*)" (should|should not) be favorited$/
|
||||||
*
|
*
|
||||||
* @param string $user
|
* @param string $user
|
||||||
* @param string $resourceName
|
* @param string $path
|
||||||
* @param string $spaceName
|
* @param string $spaceName
|
||||||
* @param string $property
|
* @param string $shouldOrNot
|
||||||
* @param string $expectedValue
|
*
|
||||||
*
|
* @return void
|
||||||
* @return void
|
*/
|
||||||
*
|
public function asUserFileOrFolderInsideSpaceShouldOrNotBeFavorited(string $user, string $path, string $spaceName, string $shouldOrNot):void {
|
||||||
* @throws Exception|GuzzleException
|
$this->setSpaceIDByName($user, $spaceName);
|
||||||
*/
|
$this->favoritesContext->asUserFileOrFolderShouldBeFavorited($user, $path, ($shouldOrNot === 'should') ? 1 : 0);
|
||||||
public function asUserFileInsideSpaceShouldContainAPropertyWithValue(
|
}
|
||||||
string $user,
|
|
||||||
string $resourceName,
|
|
||||||
string $spaceName,
|
|
||||||
string $property,
|
|
||||||
string $expectedValue
|
|
||||||
):void {
|
|
||||||
$space = $this->getSpaceByName($user, $spaceName);
|
|
||||||
$fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($resourceName, "/");
|
|
||||||
$body = WebDavHelper::getBodyForPropfind([$property]);
|
|
||||||
$headers['Depth'] = '1';
|
|
||||||
$this->featureContext->setResponse(
|
|
||||||
$this->sendPropfindRequestToUrl(
|
|
||||||
$fullUrl,
|
|
||||||
$user,
|
|
||||||
$this->featureContext->getPasswordForUser($user),
|
|
||||||
'',
|
|
||||||
$headers,
|
|
||||||
$body
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$responseXml = $this->featureContext->getResponseXml(null, __METHOD__);
|
|
||||||
$this->featureContext->setResponseXmlObject($responseXml);
|
|
||||||
$this->webDavPropertiesContext->checkSingleResponseContainsAPropertyWithValueAndAlternative(
|
|
||||||
$property,
|
|
||||||
$expectedValue,
|
|
||||||
$expectedValue
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @When /^user "([^"]*)" favorites element "([^"]*)" in space "([^"]*)" using the WebDAV API$/
|
* @When /^user "([^"]*)" favorites element "([^"]*)" in space "([^"]*)" using the WebDAV API$/
|
||||||
|
|||||||
Reference in new issue
Block a user