summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorSergio Bertolin <sbertolin@solidgear.es>2016-10-13 13:16:30 +0000
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-02 08:49:57 +0100
commita3c3ec9dd7e6d0145fac195a4338c11592589450 (patch)
treedb7765667b741a24a2e784d2e75653a6143995eb /build
parent19af06cdea5719226d851bf4ad531220d2d37bed (diff)
downloadnextcloud-server-a3c3ec9dd7e6d0145fac195a4338c11592589450.tar.gz
nextcloud-server-a3c3ec9dd7e6d0145fac195a4338c11592589450.zip
Added functions to check etag of elements
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/WebDav.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index cdb1fc3fdfd..c59d035d1e7 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -42,6 +42,8 @@ trait WebDav {
private $davPath = "remote.php/webdav";
/** @var ResponseInterface */
private $response;
+ /** @var array */
+ private $storedETAG = NULL;
/**
* @Given /^using dav path "([^"]*)"$/
@@ -599,4 +601,33 @@ trait WebDav {
public function asGetsPropertiesOfFileWith($user, $path, $propertiesTable) {
$this->asGetsPropertiesOfFolderWith($user, $path, $propertiesTable);
}
+
+ /**
+ * @Given user :user stores etag of element :path
+ */
+ public function userStoresEtagOfElement($user, $path){
+ $propertiesTable = new \Behat\Gherkin\Node\TableNode([['{DAV:}getetag']]);
+ $this->asGetsPropertiesOfFolderWith($user, $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, $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, $path, $propertiesTable);
+ PHPUnit_Framework_Assert::assertNotEquals($this->response['{DAV:}getetag'], $this->storedETAG[$user][$path]);
+ }
}