|
@@ 298-323 (lines=26) @@
|
| 295 |
|
|
| 296 |
|
|
| 297 |
|
/*Returns the elements of a propfind, $folderDepth requires 1 to see elements without children*/ |
| 298 |
|
public function listFolder($user, $path, $folderDepth, $properties = null){ |
| 299 |
|
$fullUrl = substr($this->baseUrl, 0, -4); |
| 300 |
|
|
| 301 |
|
$settings = array( |
| 302 |
|
'baseUri' => $fullUrl, |
| 303 |
|
'userName' => $user, |
| 304 |
|
); |
| 305 |
|
|
| 306 |
|
if ($user === 'admin') { |
| 307 |
|
$settings['password'] = $this->adminUser[1]; |
| 308 |
|
} else { |
| 309 |
|
$settings['password'] = $this->regularUser; |
| 310 |
|
} |
| 311 |
|
|
| 312 |
|
$client = new SClient($settings); |
| 313 |
|
|
| 314 |
|
if (!$properties) { |
| 315 |
|
$properties = [ |
| 316 |
|
'{DAV:}getetag' |
| 317 |
|
]; |
| 318 |
|
} |
| 319 |
|
|
| 320 |
|
$response = $client->propfind($this->davPath . '/' . ltrim($path, '/'), $properties, $folderDepth); |
| 321 |
|
|
| 322 |
|
return $response; |
| 323 |
|
} |
| 324 |
|
|
| 325 |
|
/** |
| 326 |
|
* @Then /^user "([^"]*)" should see following elements$/ |
|
@@ 477-497 (lines=21) @@
|
| 474 |
|
} |
| 475 |
|
|
| 476 |
|
/*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/ |
| 477 |
|
public function changeFavStateOfAnElement($user, $path, $favOrUnfav, $folderDepth, $properties = null){ |
| 478 |
|
$fullUrl = substr($this->baseUrl, 0, -4); |
| 479 |
|
$settings = array( |
| 480 |
|
'baseUri' => $fullUrl, |
| 481 |
|
'userName' => $user, |
| 482 |
|
); |
| 483 |
|
if ($user === 'admin') { |
| 484 |
|
$settings['password'] = $this->adminUser[1]; |
| 485 |
|
} else { |
| 486 |
|
$settings['password'] = $this->regularUser; |
| 487 |
|
} |
| 488 |
|
$client = new SClient($settings); |
| 489 |
|
if (!$properties) { |
| 490 |
|
$properties = [ |
| 491 |
|
'{http://owncloud.org/ns}favorite' => $favOrUnfav |
| 492 |
|
]; |
| 493 |
|
} |
| 494 |
|
|
| 495 |
|
$response = $client->proppatch($this->davPath . '/' . ltrim($path, '/'), $properties, $folderDepth); |
| 496 |
|
return $response; |
| 497 |
|
} |
| 498 |
|
|
| 499 |
|
/** |
| 500 |
|
* @Then /^as "([^"]*)" gets properties of file "([^"]*)" with$/ |