|
|
|
@ -42,6 +42,7 @@ trait WebDav { |
|
|
|
|
$request->setBody($body); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $client->send($request); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -70,6 +71,23 @@ trait WebDav { |
|
|
|
|
$this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @When /^User "([^"]*)" copies file "([^"]*)" to "([^"]*)"$/ |
|
|
|
|
* @param string $user |
|
|
|
|
* @param string $fileSource |
|
|
|
|
* @param string $fileDestination |
|
|
|
|
*/ |
|
|
|
|
public function userCopiesFileTo($user, $fileSource, $fileDestination) { |
|
|
|
|
$fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath; |
|
|
|
|
$headers['Destination'] = $fullUrl . $fileDestination; |
|
|
|
|
try { |
|
|
|
|
$this->response = $this->makeDavRequest($user, 'COPY', $fileSource, $headers); |
|
|
|
|
} catch (\GuzzleHttp\Exception\ClientException $e) { |
|
|
|
|
// 4xx and 5xx responses cause an exception |
|
|
|
|
$this->response = $e->getResponse(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @When /^Downloading file "([^"]*)" with range "([^"]*)"$/ |
|
|
|
|
* @param string $fileSource |
|
|
|
|