Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 318-325 (lines=8) @@
315
    /**
316
     * @Then /^I should see (\d+) ([^"" ]*) in (that|the) list$/
317
     */
318
    public function iShouldSeeThatMuchResourcesInTheList($amount, $type)
319
    {
320
        if (1 === count($this->getSession()->getPage()->findAll('css', 'table'))) {
321
            $this->assertSession()->elementsCount('css', 'table tbody > tr', $amount);
322
        } else {
323
            $this->assertSession()->elementsCount('css', sprintf('table#%s tbody > tr', str_replace(' ', '-', $type)), $amount);
324
        }
325
    }
326
327
    /**
328
     * @Then /^I should be on the page of ([^""]*) with ([^""]*) "([^""]*)"$/
@@ 630-637 (lines=8) @@
627
    /**
628
     * @Then /^I should see (\d+) ([^" ]*) servers in (that|the) list$/
629
     */
630
    public function iShouldSeeThatMuchServersInTheList($amount, $type)
631
    {
632
        if (1 === count($this->getSession()->getPage()->findAll('css', '.server-list'))) {
633
            $this->assertSession()->elementsCount('css', '.server-list > .server-item', $amount);
634
        } else {
635
            $this->assertSession()->elementsCount('css', sprintf('#%s.server-list > .server-item', $type), $amount);
636
        }
637
    }
638
}
639

src/DP/Core/CoreBundle/Behat/ServerContext.php 1 location

@@ 196-203 (lines=8) @@
193
    /**
194
     * @Then /^I should see (\d+) ([^" ]*) instances in (that|the) list$/
195
     */
196
    public function iShouldSeeThatMuchInstancesInTheList($amount, $type)
197
    {
198
        if (1 === count($this->getSession()->getPage()->findAll('css', '.instance-list'))) {
199
            $this->assertSession()->elementsCount('css', '.instance-list > .instance-item', $amount);
200
        } else {
201
            $this->assertSession()->elementsCount('css', sprintf('#%s.instance-list > .instance-item', $type), $amount);
202
        }
203
    }
204
205
    /**
206
     * @Given /^there are following minecraft servers:$/