summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap/WebDav.php
diff options
context:
space:
mode:
Diffstat (limited to 'build/integration/features/bootstrap/WebDav.php')
-rw-r--r--build/integration/features/bootstrap/WebDav.php42
1 files changed, 41 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index 2db51d8b22f..09e2680e5ed 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -208,6 +208,19 @@ trait WebDav {
}
/**
+ * @Then /^File "([^"]*)" should have prop "([^"]*):([^"]*)" equal to "([^"]*)"$/
+ * @param string $file
+ * @param string $prefix
+ * @param string $prop
+ * @param string $value
+ */
+ public function checkPropForFile($file, $prefix, $prop, $value) {
+ $elementList = $this->propfindFile($this->currentUser, $file, "<$prefix:$prop/>");
+ $property = $elementList['/'.$this->getDavFilesPath($this->currentUser).$file][200]["{DAV:}$prop"];
+ Assert::assertEquals($property, $value);
+ }
+
+ /**
* @Then /^Downloaded content when downloading file "([^"]*)" with range "([^"]*)" should be "([^"]*)"$/
* @param string $fileSource
* @param string $range
@@ -386,6 +399,30 @@ trait WebDav {
* @param string $properties properties which needs to be included in the report
* @param string $filterRules filter-rules to choose what needs to appear in the report
*/
+ public function propfindFile($user, $path, $properties = '') {
+ $client = $this->getSabreClient($user);
+
+ $body = '<?xml version="1.0" encoding="utf-8" ?>
+ <d:propfind xmlns:d="DAV:"
+ xmlns:oc="http://owncloud.org/ns"
+ xmlns:nc="http://nextcloud.org/ns"
+ xmlns:ocs="http://open-collaboration-services.org/ns">
+ <d:prop>
+ ' . $properties . '
+ </d:prop>
+ </d:propfind>';
+
+ $response = $client->request('PROPFIND', $this->makeSabrePath($user, $path), $body);
+ $parsedResponse = $client->parseMultistatus($response['body']);
+ return $parsedResponse;
+ }
+
+ /* Returns the elements of a report command
+ * @param string $user
+ * @param string $path
+ * @param string $properties properties which needs to be included in the report
+ * @param string $filterRules filter-rules to choose what needs to appear in the report
+ */
public function reportFolder($user, $path, $properties, $filterRules) {
$client = $this->getSabreClient($user);
@@ -561,25 +598,28 @@ trait WebDav {
* @param string $name3
* @param string $content3
*/
- public function userUploadsChunkedFiles($user, $name1, $content1, $name2, $content2, $name3, $content3) {
+ public function userUploadsBulkedFiles($user, $name1, $content1, $name2, $content2, $name3, $content3) {
$boundary = "boundary_azertyuiop";
$body = "";
$body .= '--'.$boundary."\r\n";
$body .= "X-File-Path: ".$name1."\r\n";
$body .= "X-File-MD5: f6a6263167c92de8644ac998b3c4e4d1\r\n";
+ $body .= "X-OC-Mtime: 1111111111\r\n";
$body .= "Content-Length: ".strlen($content1)."\r\n";
$body .= "\r\n";
$body .= $content1."\r\n";
$body .= '--'.$boundary."\r\n";
$body .= "X-File-Path: ".$name2."\r\n";
$body .= "X-File-MD5: 87c7d4068be07d390a1fffd21bf1e944\r\n";
+ $body .= "X-OC-Mtime: 2222222222\r\n";
$body .= "Content-Length: ".strlen($content2)."\r\n";
$body .= "\r\n";
$body .= $content2."\r\n";
$body .= '--'.$boundary."\r\n";
$body .= "X-File-Path: ".$name3."\r\n";
$body .= "X-File-MD5: e86a1cf0678099986a901c79086f5617\r\n";
+ $body .= "X-File-Mtime: 3333333333\r\n";
$body .= "Content-Length: ".strlen($content3)."\r\n";
$body .= "\r\n";
$body .= $content3."\r\n";