|
@@ 365-373 (lines=9) @@
|
| 362 |
|
/** |
| 363 |
|
* @Given /^I am (building|viewing|editing) ([^""]*) with ([^""]*) "([^""]*)"$/ |
| 364 |
|
*/ |
| 365 |
|
public function iAmDoingSomethingWithResource($action, $type, $property, $value) |
| 366 |
|
{ |
| 367 |
|
$type = str_replace(' ', '_', $type); |
| 368 |
|
|
| 369 |
|
$action = str_replace(array_keys($this->actions), array_values($this->actions), $action); |
| 370 |
|
$resource = $this->findOneBy($type, array($property => $value)); |
| 371 |
|
|
| 372 |
|
$this->getSession()->visit($this->generatePageUrl(sprintf('%s_%s', $type, $action), array('id' => $resource->getId()))); |
| 373 |
|
} |
| 374 |
|
|
| 375 |
|
/** |
| 376 |
|
* @Given /^I am (building|viewing|editing) (?!teamspeak)([^""(w)]*) "([^""]*)"$/ |
|
@@ 386-395 (lines=10) @@
|
| 383 |
|
/** |
| 384 |
|
* @Then /^I should be (building|viewing|editing|testing) ([^"]*) with ([^"]*) "([^""]*)"$/ |
| 385 |
|
*/ |
| 386 |
|
public function iShouldBeDoingSomethingWithResource($action, $type, $property, $value) |
| 387 |
|
{ |
| 388 |
|
$type = str_replace(' ', '_', $type); |
| 389 |
|
|
| 390 |
|
$action = str_replace(array_keys($this->actions), array_values($this->actions), $action); |
| 391 |
|
$resource = $this->findOneBy($type, array($property => $value)); |
| 392 |
|
|
| 393 |
|
$this->assertSession()->addressEquals($this->generatePageUrl(sprintf('dedipanel_%s_%s', $type, $action), array('id' => $resource->getId()))); |
| 394 |
|
$this->assertStatusCodeEquals(200); |
| 395 |
|
} |
| 396 |
|
|
| 397 |
|
/** |
| 398 |
|
* @Then /^I should be (building|viewing|editing) (?!teamspeak)([^""(w)]*) "([^""]*)"$/ |