diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2016-10-13 16:16:30 +0300 |
---|---|---|
committer | Sergio Bertolin <sbertolin@solidgear.es> | 2016-11-23 16:21:41 +0300 |
commit | 274be16d6ec3f02eb10125fb1262e10e0fc7e59d (patch) | |
tree | bdde44ef84b07e6555395908026379760c7de1f8 | |
parent | af12b542a9051ebb241cab546b87f8e2d51a241c (diff) |
Added functions to check etag of elements
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 31 |
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]); + } + } |