@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @When /^sending "([^"]*)" to "([^"]*)" with$/ |
| 121 | 121 | * @param string $verb |
| 122 | 122 | * @param string $url |
| 123 | - * @param \Behat\Gherkin\Node\TableNode $body |
|
| 123 | + * @param null|Behat\Gherkin\Node\TableNode $body |
|
| 124 | 124 | */ |
| 125 | 125 | public function sendingToWith($verb, $url, $body) { |
| 126 | 126 | $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php" . $url; |
@@ -143,6 +143,10 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | + /** |
|
| 147 | + * @param string $possibleUrl |
|
| 148 | + * @param string $finalPart |
|
| 149 | + */ |
|
| 146 | 150 | public function isExpectedUrl($possibleUrl, $finalPart){ |
| 147 | 151 | $baseUrlChopped = substr($this->baseUrl, 0, -4); |
| 148 | 152 | $endCharacter = strlen($baseUrlChopped) + strlen($finalPart); |
@@ -150,6 +150,10 @@ |
||
| 150 | 150 | PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode()); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | + /** |
|
| 154 | + * @param string $user |
|
| 155 | + * @param string $group |
|
| 156 | + */ |
|
| 153 | 157 | public function userBelongsToGroup($user, $group) { |
| 154 | 158 | $fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups"; |
| 155 | 159 | $client = new Client(); |
@@ -160,6 +160,12 @@ discard block |
||
| 160 | 160 | PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode()); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | + /** |
|
| 164 | + * @param string $user |
|
| 165 | + * @param string $path |
|
| 166 | + * @param integer $shareType |
|
| 167 | + * @param string $shareWith |
|
| 168 | + */ |
|
| 163 | 169 | public function createShare($user, |
| 164 | 170 | $path = null, |
| 165 | 171 | $shareType = null, |
@@ -284,6 +290,9 @@ discard block |
||
| 284 | 290 | PHPUnit_Framework_Assert::assertEquals(False, $this->isFieldInResponse('share_with', "$user")); |
| 285 | 291 | } |
| 286 | 292 | |
| 293 | + /** |
|
| 294 | + * @param string $userOrGroup |
|
| 295 | + */ |
|
| 287 | 296 | public function isUserOrGroupInSharedData($userOrGroup){ |
| 288 | 297 | $data = $this->response->xml()->data[0]; |
| 289 | 298 | foreach($data as $element) { |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | use GuzzleHttp\Client; |
| 4 | -use GuzzleHttp\Message\ResponseInterface; |
|
| 5 | 4 | |
| 6 | 5 | require __DIR__ . '/../../vendor/autoload.php'; |
| 7 | 6 | |
@@ -22,6 +22,9 @@ discard block |
||
| 22 | 22 | $this->davPath = $davPath; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | + /** |
|
| 26 | + * @param string $method |
|
| 27 | + */ |
|
| 25 | 28 | public function makeDavRequest($user, $method, $path, $headers, $body = null){ |
| 26 | 29 | $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path"; |
| 27 | 30 | $client = new GClient(); |
@@ -295,6 +298,12 @@ discard block |
||
| 295 | 298 | |
| 296 | 299 | |
| 297 | 300 | /*Returns the elements of a propfind, $folderDepth requires 1 to see elements without children*/ |
| 301 | + |
|
| 302 | + /** |
|
| 303 | + * @param string $user |
|
| 304 | + * @param string $path |
|
| 305 | + * @param integer $folderDepth |
|
| 306 | + */ |
|
| 298 | 307 | public function listFolder($user, $path, $folderDepth, $properties = null){ |
| 299 | 308 | $fullUrl = substr($this->baseUrl, 0, -4); |
| 300 | 309 | |
@@ -474,6 +483,11 @@ discard block |
||
| 474 | 483 | } |
| 475 | 484 | |
| 476 | 485 | /*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/ |
| 486 | + |
|
| 487 | + /** |
|
| 488 | + * @param integer $favOrUnfav |
|
| 489 | + * @param integer $folderDepth |
|
| 490 | + */ |
|
| 477 | 491 | public function changeFavStateOfAnElement($user, $path, $favOrUnfav, $folderDepth, $properties = null){ |
| 478 | 492 | $fullUrl = substr($this->baseUrl, 0, -4); |
| 479 | 493 | $settings = array( |