|
@@ 27-38 (lines=12) @@
|
| 24 |
|
* @Given /^user "([^"]*)" exists$/ |
| 25 |
|
* @param string $user |
| 26 |
|
*/ |
| 27 |
|
public function assureUserExists($user) { |
| 28 |
|
try { |
| 29 |
|
$this->userExists($user); |
| 30 |
|
} catch (\GuzzleHttp\Exception\ClientException $ex) { |
| 31 |
|
$previous_user = $this->currentUser; |
| 32 |
|
$this->currentUser = "admin"; |
| 33 |
|
$this->creatingTheUser($user); |
| 34 |
|
$this->currentUser = $previous_user; |
| 35 |
|
} |
| 36 |
|
$this->userExists($user); |
| 37 |
|
PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode()); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
/** |
| 41 |
|
* @Given /^user "([^"]*)" does not exist$/ |
|
@@ 322-333 (lines=12) @@
|
| 319 |
|
* @Given /^group "([^"]*)" exists$/ |
| 320 |
|
* @param string $group |
| 321 |
|
*/ |
| 322 |
|
public function assureGroupExists($group) { |
| 323 |
|
try { |
| 324 |
|
$this->groupExists($group); |
| 325 |
|
} catch (\GuzzleHttp\Exception\ClientException $ex) { |
| 326 |
|
$previous_user = $this->currentUser; |
| 327 |
|
$this->currentUser = "admin"; |
| 328 |
|
$this->creatingTheGroup($group); |
| 329 |
|
$this->currentUser = $previous_user; |
| 330 |
|
} |
| 331 |
|
$this->groupExists($group); |
| 332 |
|
PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode()); |
| 333 |
|
} |
| 334 |
|
|
| 335 |
|
/** |
| 336 |
|
* @Given /^group "([^"]*)" does not exist$/ |