|
@@ 44-62 (lines=19) @@
|
| 41 |
|
* @Given /^user "([^"]*)" does not exist$/ |
| 42 |
|
* @param string $user |
| 43 |
|
*/ |
| 44 |
|
public function userDoesNotExist($user) { |
| 45 |
|
try { |
| 46 |
|
$this->userExists($user); |
| 47 |
|
} catch (\GuzzleHttp\Exception\ClientException $ex) { |
| 48 |
|
$this->response = $ex->getResponse(); |
| 49 |
|
PHPUnit_Framework_Assert::assertEquals(404, $ex->getResponse()->getStatusCode()); |
| 50 |
|
return; |
| 51 |
|
} |
| 52 |
|
$previous_user = $this->currentUser; |
| 53 |
|
$this->currentUser = "admin"; |
| 54 |
|
$this->deletingTheUser($user); |
| 55 |
|
$this->currentUser = $previous_user; |
| 56 |
|
try { |
| 57 |
|
$this->userExists($user); |
| 58 |
|
} catch (\GuzzleHttp\Exception\ClientException $ex) { |
| 59 |
|
$this->response = $ex->getResponse(); |
| 60 |
|
PHPUnit_Framework_Assert::assertEquals(404, $ex->getResponse()->getStatusCode()); |
| 61 |
|
} |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function creatingTheUser($user) { |
| 65 |
|
$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/users"; |
|
@@ 339-357 (lines=19) @@
|
| 336 |
|
* @Given /^group "([^"]*)" does not exist$/ |
| 337 |
|
* @param string $group |
| 338 |
|
*/ |
| 339 |
|
public function groupDoesNotExist($group) { |
| 340 |
|
try { |
| 341 |
|
$this->groupExists($group); |
| 342 |
|
} catch (\GuzzleHttp\Exception\ClientException $ex) { |
| 343 |
|
$this->response = $ex->getResponse(); |
| 344 |
|
PHPUnit_Framework_Assert::assertEquals(404, $ex->getResponse()->getStatusCode()); |
| 345 |
|
return; |
| 346 |
|
} |
| 347 |
|
$previous_user = $this->currentUser; |
| 348 |
|
$this->currentUser = "admin"; |
| 349 |
|
$this->deletingTheGroup($group); |
| 350 |
|
$this->currentUser = $previous_user; |
| 351 |
|
try { |
| 352 |
|
$this->groupExists($group); |
| 353 |
|
} catch (\GuzzleHttp\Exception\ClientException $ex) { |
| 354 |
|
$this->response = $ex->getResponse(); |
| 355 |
|
PHPUnit_Framework_Assert::assertEquals(404, $ex->getResponse()->getStatusCode()); |
| 356 |
|
} |
| 357 |
|
} |
| 358 |
|
|
| 359 |
|
/** |
| 360 |
|
* @Given /^user "([^"]*)" is subadmin of group "([^"]*)"$/ |