Reuse code from core for shareOperation
This commit is contained in:
1 parent
94b9838a08
commit
fa998e4600
2 files changed
+12
-34
No files matched your search
@@ -17,7 +17,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "19"
|
And the single response should contain a property "ocs:share-permissions" with value "19"
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "19"
|
And the single response should contain a property "ocs:share-permissions" with value "19"
|
||||||
|
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "3"
|
And the single response should contain a property "ocs:share-permissions" with value "3"
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "17"
|
And the single response should contain a property "ocs:share-permissions" with value "17"
|
||||||
|
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "31"
|
And the single response should contain a property "ocs:share-permissions" with value "31"
|
||||||
|
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "31"
|
And the single response should contain a property "ocs:share-permissions" with value "31"
|
||||||
|
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "29"
|
And the single response should contain a property "ocs:share-permissions" with value "29"
|
||||||
|
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "27"
|
And the single response should contain a property "ocs:share-permissions" with value "27"
|
||||||
|
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "23"
|
And the single response should contain a property "ocs:share-permissions" with value "23"
|
||||||
|
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ Feature: sharing
|
|||||||
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API
|
||||||
| propertyName |
|
| propertyName |
|
||||||
| ocs:share-permissions |
|
| ocs:share-permissions |
|
||||||
Then the HTTP status code should be "207"
|
Then the HTTP status code should be "200"
|
||||||
And the single response should contain a property "ocs:share-permissions" with value "15"
|
And the single response should contain a property "ocs:share-permissions" with value "15"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3122,30 +3122,8 @@ class SpacesContext implements Context {
|
|||||||
string $spaceName,
|
string $spaceName,
|
||||||
TableNode $propertiesTable
|
TableNode $propertiesTable
|
||||||
):void {
|
):void {
|
||||||
$space = $this->getSpaceByName($user, $spaceName);
|
$this->setSpaceIDByName($user, $spaceName);
|
||||||
$properties = null;
|
$this->webDavPropertiesContext->userGetsPropertiesOfFolder($user, $resourceName, $propertiesTable);
|
||||||
$fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($resourceName, "/");
|
|
||||||
$this->featureContext->verifyTableNodeColumns($propertiesTable, ["propertyName"]);
|
|
||||||
$this->featureContext->verifyTableNodeColumnsCount($propertiesTable, 1);
|
|
||||||
if ($propertiesTable instanceof TableNode) {
|
|
||||||
foreach ($propertiesTable->getColumnsHash() as $row) {
|
|
||||||
$properties[] = $row["propertyName"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$body = WebDavHelper::getBodyForPropfind($properties);
|
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user