|
@@ 350-359 (lines=10) @@
|
| 347 |
|
* @param string $source |
| 348 |
|
* @param string $destination |
| 349 |
|
*/ |
| 350 |
|
public function userUploadsAFileTo($user, $source, $destination) |
| 351 |
|
{ |
| 352 |
|
$file = \GuzzleHttp\Stream\Stream::factory(fopen($source, 'r')); |
| 353 |
|
try { |
| 354 |
|
$this->response = $this->makeDavRequest($user, "PUT", $destination, [], $file); |
| 355 |
|
} catch (\GuzzleHttp\Exception\ServerException $e) { |
| 356 |
|
// 4xx and 5xx responses cause an exception |
| 357 |
|
$this->response = $e->getResponse(); |
| 358 |
|
} |
| 359 |
|
} |
| 360 |
|
|
| 361 |
|
/** |
| 362 |
|
* @When User :user uploads file with content :content to :destination |
|
@@ 364-373 (lines=10) @@
|
| 361 |
|
/** |
| 362 |
|
* @When User :user uploads file with content :content to :destination |
| 363 |
|
*/ |
| 364 |
|
public function userUploadsAFileWithContentTo($user, $content, $destination) |
| 365 |
|
{ |
| 366 |
|
$file = \GuzzleHttp\Stream\Stream::factory($content); |
| 367 |
|
try { |
| 368 |
|
$this->response = $this->makeDavRequest($user, "PUT", $destination, [], $file); |
| 369 |
|
} catch (\GuzzleHttp\Exception\ServerException $e) { |
| 370 |
|
// 4xx and 5xx responses cause an exception |
| 371 |
|
$this->response = $e->getResponse(); |
| 372 |
|
} |
| 373 |
|
} |
| 374 |
|
|
| 375 |
|
/** |
| 376 |
|
* @When User :user deletes file :file |