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:
Diffstat (limited to 'build/integration/features/bootstrap/WebDav.php')
-rw-r--r--build/integration/features/bootstrap/WebDav.php40
1 files changed, 39 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index cd9584ad186..a63e2a59218 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -434,5 +434,43 @@ trait WebDav {
$this->response = $ex->getResponse();
}
}
-}
+ /*
+ * @When user "([^"]*)" favorites folder "([^"]*)"
+ * @param string $user
+ * @param string $path
+ * @param \Behat\Gherkin\Node\TableNode|null $propertiesTable
+ */
+ public function userFavoritesFolder($user, $path, $propertiesTable) {
+ $properties = null;
+ if ($propertiesTable instanceof \Behat\Gherkin\Node\TableNode) {
+ foreach ($propertiesTable->getRows() as $row) {
+ $properties[] = $row[0];
+ }
+ }
+ $this->response = $this->favFolder($user, $path, 0, $properties);
+ }
+
+ /*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/
+ public function favFolder($user, $path, $folderDepth, $properties = null){
+ $fullUrl = substr($this->baseUrl, 0, -4);
+ $settings = array(
+ 'baseUri' => $fullUrl,
+ 'userName' => $user,
+ );
+ if ($user === 'admin') {
+ $settings['password'] = $this->adminUser[1];
+ } else {
+ $settings['password'] = $this->regularUser;
+ }
+ $client = new SClient($settings);
+ if (!$properties) {
+ $properties = [
+ '{http://owncloud.org/ns}favorite'
+ ];
+ }
+ echo $properties,
+ $response = $client->proppatch($this->davPath . '/' . ltrim($path, '/'), $properties, $folderDepth);
+ return $response;
+ }
+}