Skip to content
Merged
Show file tree
Hide file tree
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
31 changes: 31 additions & 0 deletions build/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ trait WebDav {
private $usingOldDavPath = true;
/** @var ResponseInterface */
private $response;
/** @var map with user as key and another map as value, which has path as key and etag as value */
private $storedETAG = NULL;

/**
* @Given /^using dav path "([^"]*)"$/
Expand Down Expand Up @@ -585,4 +587,33 @@ public function changeFavStateOfAnElement($user, $path, $favOrUnfav, $folderDept
return $response;
}

/**
* @Given user :user stores etag of element :path
*/
public function userStoresEtagOfElement($user, $path){
$propertiesTable = new \Behat\Gherkin\Node\TableNode([['{DAV:}getetag']]);
$this->asGetsPropertiesOfFolderWith($user, NULL, $path, $propertiesTable);
$pathETAG[$path] = $this->response['{DAV:}getetag'];
$this->storedETAG[$user]= $pathETAG;
print_r($this->storedETAG[$user][$path]);
}

/**
* @Then etag of element :path of user :user has not changed
*/
public function checkIfETAGHasNotChanged($path, $user){
$propertiesTable = new \Behat\Gherkin\Node\TableNode([['{DAV:}getetag']]);
$this->asGetsPropertiesOfFolderWith($user, NULL, $path, $propertiesTable);
PHPUnit_Framework_Assert::assertEquals($this->response['{DAV:}getetag'], $this->storedETAG[$user][$path]);
}

/**
* @Then etag of element :path of user :user has changed
*/
public function checkIfETAGHasChanged($path, $user){
$propertiesTable = new \Behat\Gherkin\Node\TableNode([['{DAV:}getetag']]);
$this->asGetsPropertiesOfFolderWith($user, NULL, $path, $propertiesTable);
PHPUnit_Framework_Assert::assertNotEquals($this->response['{DAV:}getetag'], $this->storedETAG[$user][$path]);
}

}
15 changes: 15 additions & 0 deletions build/integration/features/sharing-v1.feature
Original file line number Diff line number Diff line change
Expand Up @@ -901,3 +901,18 @@ Feature: sharing
Then the OCS status code should be "100"
And the HTTP status code should be "200"

Scenario: unshare from self
Given As an "admin"
And user "user0" exists
And user "user1" exists
And group "sharing-group" exists
And user "user0" belongs to group "sharing-group"
And user "user1" belongs to group "sharing-group"
And file "/PARENT/parent.txt" of user "user0" is shared with group "sharing-group"
And user "user0" stores etag of element "/PARENT"
And user "user1" stores etag of element "/"
And As an "user1"
When Deleting last share
Then etag of element "/" of user "user1" has changed
And etag of element "/PARENT" of user "user0" has not changed