Code Duplication    Length = 11-12 lines in 2 locations

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

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