Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Bertolin <sbertolin@solidgear.es>2016-10-13 16:16:30 +0300
committerSergio Bertolin <sbertolin@solidgear.es>2016-11-23 16:21:41 +0300
commit274be16d6ec3f02eb10125fb1262e10e0fc7e59d (patch)
treebdde44ef84b07e6555395908026379760c7de1f8
parentaf12b542a9051ebb241cab546b87f8e2d51a241c (diff)
Added functions to check etag of elements
-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 dc55571504b..20c03073ab2 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -16,6 +16,8 @@ trait WebDav {
private $usingOldDavPath = true;
/** @var ResponseInterface */
private $response;
+ /** @var array */
+ private $storedETAG = NULL;
/**
* @Given /^using dav path "([^"]*)"$/
@@ -587,4 +589,33 @@ trait WebDav {
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]);
+ }
+
}