From a2938385f9f5d585eacdbe15791b913614c94f9d Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Fri, 20 Nov 2015 11:26:52 +0000 Subject: Making webdav path configurable --- build/integration/features/bootstrap/FeatureContext.php | 16 +++++++++++++--- build/integration/features/sharing-v1.feature | 1 + build/integration/features/webdav-related.feature | 15 +++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) (limited to 'build') diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 3a4b619fe7a..b3d928bb21d 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -27,6 +27,9 @@ class FeatureContext implements Context, SnippetAcceptingContext { /** @var int */ private $sharingApiVersion = 1; + /** @var string*/ + private $davPath = "remote.php/webdav"; + /** @var SimpleXMLElement */ private $lastShareData = null; @@ -211,6 +214,13 @@ class FeatureContext implements Context, SnippetAcceptingContext { $this->apiVersion = $version; } + /** + * @Given /^using dav path "([^"]*)"$/ + */ + public function usingDavPath($davPath) { + $this->davPath = $davPath; + } + /** * @Given /^user "([^"]*)" exists$/ */ @@ -906,7 +916,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { } public function makeDavRequest($user, $method, $path, $headers){ - $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav" . "$path"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path"; $client = new Client(); $options = []; if ($user === 'admin') { @@ -926,7 +936,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { * @Given /^User "([^"]*)" moved file "([^"]*)" to "([^"]*)"$/ */ public function userMovedFile($user, $fileSource, $fileDestination){ - $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath; $headers['Destination'] = $fullUrl . $fileDestination; $this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers); PHPUnit_Framework_Assert::assertEquals(201, $this->response->getStatusCode()); @@ -936,7 +946,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { * @When /^User "([^"]*)" moves file "([^"]*)" to "([^"]*)"$/ */ public function userMovesFile($user, $fileSource, $fileDestination){ - $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath; $headers['Destination'] = $fullUrl . $fileDestination; $this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers); } diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 0d64fcd8bcb..33085866bf4 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -1,6 +1,7 @@ Feature: sharing Background: Given using api version "1" + Given using dav path "remote.php/webdav" Scenario: Creating a new share with user Given user "user0" exists diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature index 450065ded2d..27d354644d0 100644 --- a/build/integration/features/webdav-related.feature +++ b/build/integration/features/webdav-related.feature @@ -1,12 +1,15 @@ Feature: sharing Background: - Given using api version "1" + Given using api version "1" + + Scenario: moving a file old way + Given using dav path "remote.php/webdav" + And As an "admin" + And user "user0" exists + When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" + Then the HTTP status code should be "201" + - Scenario: moving a file - Given As an "admin" - And user "user0" exists - When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" - Then the HTTP status code should be "201" -- cgit v1.2.3