Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 129-139 (lines=11) @@
126
    /**
127
     * @Given /^I am (building|viewing|editing) (teamspeak) "([^""]*)"$/
128
     */
129
    public function iAmDoingSomethingWithVoipServer($action, $type, $value)
130
    {
131
        $type = str_replace(' ', '_', $type);
132
133
        $action = str_replace(array_keys($this->actions), array_values($this->actions), $action);
134
        $parts   = explode('@', $value);
135
        $machine = $this->findOneBy('machine', array('username' => $parts[0]));
136
        $server  = $this->findOneBy($type, array('machine' => $machine->getId()));
137
138
        $this->getSession()->visit($this->generatePageUrl(sprintf('dedipanel_%s_%s', $type, $action), array('id' => $server->getId())));
139
    }
140
141
    /**
142
     * @Then /^I should be (building|viewing|editing|testing) (teamspeak) "([^""]*)"$/
@@ 144-155 (lines=12) @@
141
    /**
142
     * @Then /^I should be (building|viewing|editing|testing) (teamspeak) "([^""]*)"$/
143
     */
144
    public function iShouldBeDoingSomethingWithVoipServer($action, $type, $value)
145
    {
146
        $type = str_replace(' ', '_', $type);
147
148
        $action  = str_replace(array_keys($this->actions), array_values($this->actions), $action);
149
        $parts   = explode('@', $value);
150
        $machine = $this->findOneBy('machine', array('username' => $parts[0]));
151
        $server  = $this->findOneBy($type, array('machine' => $machine->getId()));
152
153
        $this->assertSession()->addressEquals($this->generatePageUrl(sprintf('dedipanel_%s_%s', $type, $action), array('id' => $server->getId())));
154
        $this->assertStatusCodeEquals(200);
155
    }
156
157
    /**
158
     * @When /^I (?:click|press|follow) "([^"]*)" near "([^"]*)"$/