@@ 289-297 (lines=9) @@ | ||
286 | /** |
|
287 | * @Given /^I am (building|viewing|editing) ([^""]*) with ([^""]*) "([^""]*)"$/ |
|
288 | */ |
|
289 | public function iAmDoingSomethingWithResource($action, $type, $property, $value) |
|
290 | { |
|
291 | $type = str_replace(' ', '_', $type); |
|
292 | ||
293 | $action = str_replace(array_keys($this->actions), array_values($this->actions), $action); |
|
294 | $resource = $this->findOneBy($type, array($property => $value)); |
|
295 | ||
296 | $this->getSession()->visit($this->generatePageUrl(sprintf('%s_%s', $type, $action), array('id' => $resource->getId()))); |
|
297 | } |
|
298 | ||
299 | /** |
|
300 | * @Given /^I am (building|viewing|editing) (?!teamspeak)([^""(w)]*) "([^""]*)"$/ |
|
@@ 310-319 (lines=10) @@ | ||
307 | /** |
|
308 | * @Then /^I should be (building|viewing|editing|testing) ([^"]*) with ([^"]*) "([^""]*)"$/ |
|
309 | */ |
|
310 | public function iShouldBeDoingSomethingWithResource($action, $type, $property, $value) |
|
311 | { |
|
312 | $type = str_replace(' ', '_', $type); |
|
313 | ||
314 | $action = str_replace(array_keys($this->actions), array_values($this->actions), $action); |
|
315 | $resource = $this->findOneBy($type, array($property => $value)); |
|
316 | ||
317 | $this->assertSession()->addressEquals($this->generatePageUrl(sprintf('dedipanel_%s_%s', $type, $action), array('id' => $resource->getId()))); |
|
318 | $this->assertStatusCodeEquals(200); |
|
319 | } |
|
320 | ||
321 | /** |
|
322 | * @Then /^I should be (building|viewing|editing) (?!teamspeak)([^""(w)]*) "([^""]*)"$/ |