aboutsummaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap/WebDav.php
diff options
context:
space:
mode:
authorSergio Bertolin <sbertolin@solidgear.es>2017-03-27 10:27:23 +0000
committerJoas Schilling <coding@schilljs.com>2017-04-26 15:24:19 +0200
commit9ab17c95c0746cced8a4f36bec58dc98ee229ef3 (patch)
tree6e3b634839cef9e0cfdbb709a46a2384b0b3b781 /build/integration/features/bootstrap/WebDav.php
parent5b5c3a1773dab4960d41aafc4150859a308311b7 (diff)
downloadnextcloud-server-9ab17c95c0746cced8a4f36bec58dc98ee229ef3.tar.gz
nextcloud-server-9ab17c95c0746cced8a4f36bec58dc98ee229ef3.zip
Added test about checking file id after a move
Diffstat (limited to 'build/integration/features/bootstrap/WebDav.php')
-rw-r--r--build/integration/features/bootstrap/WebDav.php35
1 files changed, 33 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index 3a018a2d0fa..9242b80ac13 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -45,8 +45,10 @@ 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;
+ /** @var array map with user as key and another map as value, which has path as key and etag as value */
+ private $storedETAG = null;
+ /** @var int */
+ private $storedFileID = null;
/**
* @Given /^using dav path "([^"]*)"$/
@@ -749,4 +751,33 @@ trait WebDav {
}
+ /**
+ * @param string $user
+ * @param string $path
+ * @return int
+ */
+ private function getFileIdForPath($user, $path) {
+ $propertiesTable = new \Behat\Gherkin\Node\TableNode([["{http://owncloud.org/ns}fileid"]]);
+ $this->asGetsPropertiesOfFolderWith($user, 'file', $path, $propertiesTable);
+ return (int) $this->response['{http://owncloud.org/ns}fileid'];
+ }
+
+ /**
+ * @Given /^User "([^"]*)" stores id of file "([^"]*)"$/
+ * @param string $user
+ * @param string $path
+ */
+ public function userStoresFileIdForPath($user, $path) {
+ $this->storedFileID = $this->getFileIdForPath($user, $path);
+ }
+
+ /**
+ * @Given /^User "([^"]*)" checks id of file "([^"]*)"$/
+ * @param string $user
+ * @param string $path
+ */
+ public function userChecksFileIdForPath($user, $path) {
+ $currentFileID = $this->getFileIdForPath($user, $path);
+ PHPUnit_Framework_Assert::assertEquals($currentFileID, $this->storedFileID);
+ }
}