Code Duplication    Length = 7-8 lines in 2 locations

src/DP/Core/CoreBundle/Behat/ServerContext.php 2 locations

@@ 64-70 (lines=7) @@
61
    /**
62
     * @Given /^I am (building|viewing|editing) (teamspeak) instance "([^""]*)"$/
63
     */
64
    public function iAmDoingSomethingWithVoipResourceByName($action, $type, $name)
65
    {
66
        $action = str_replace(array_keys($this->actions), array_values($this->actions), $action);
67
        $resource = $this->findOneBy('instance', array('name' => $name), $type);
68
69
        $this->getSession()->visit($this->generatePageUrl(sprintf('%s_instance_%s', $type, $action), array('id' => $resource->getId(), 'serverId' => $resource->getServer()->getId())));
70
    }
71
72
    /**
73
     * @Then /^I should be (building|viewing|editing) (teamspeak) instance "([^""]*)"$/
@@ 76-83 (lines=8) @@
73
     * @Then /^I should be (building|viewing|editing) (teamspeak) instance "([^""]*)"$/
74
     * @Then /^I should still be (building|viewing|editing) (teamspeak) instance "([^""]*)"$/
75
     */
76
    public function iShouldBeDoingSomethingWithVoipResourceByName($action, $type, $name)
77
    {
78
        $action = str_replace(array_keys($this->actions), array_values($this->actions), $action);
79
        $resource = $this->findOneBy('instance', array('name' => $name), $type);
80
81
        $this->assertSession()->addressEquals($this->generatePageUrl(sprintf('%s_instance_%s', $type, $action), array('id' => $resource->getId(), 'serverId' => $resource->getServer()->getId())));
82
        $this->assertStatusCodeEquals(200);
83
    }
84
85
    /**
86
     * @Then /^I should be on the page of ([^""(w)]*) server "([^""]*)"$/