Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 242-249 (lines=8) @@
239
    /**
240
     * @Then /^I should see (\d+) ([^"" ]*) in (that|the) list$/
241
     */
242
    public function iShouldSeeThatMuchResourcesInTheList($amount, $type)
243
    {
244
        if (1 === count($this->getSession()->getPage()->findAll('css', 'table'))) {
245
            $this->assertSession()->elementsCount('css', 'table tbody > tr', $amount);
246
        } else {
247
            $this->assertSession()->elementsCount('css', sprintf('table#%s tbody > tr', str_replace(' ', '-', $type)), $amount);
248
        }
249
    }
250
251
    /**
252
     * @Then /^I should be on the page of ([^""]*) with ([^""]*) "([^""]*)"$/
@@ 415-422 (lines=8) @@
412
    /**
413
     * @Then /^I should see (\d+) ([^" ]*) servers in (that|the) list$/
414
     */
415
    public function iShouldSeeThatMuchServersInTheList($amount, $type)
416
    {
417
        if (1 === count($this->getSession()->getPage()->findAll('css', '.server-list'))) {
418
            $this->assertSession()->elementsCount('css', '.server-list > .server-item', $amount);
419
        } else {
420
            $this->assertSession()->elementsCount('css', sprintf('#%s.server-list > .server-item', $type), $amount);
421
        }
422
    }
423
}

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

@@ 189-196 (lines=8) @@
186
    /**
187
     * @Then /^I should see (\d+) ([^" ]*) instances in (that|the) list$/
188
     */
189
    public function iShouldSeeThatMuchInstancesInTheList($amount, $type)
190
    {
191
        if (1 === count($this->getSession()->getPage()->findAll('css', '.instance-list'))) {
192
            $this->assertSession()->elementsCount('css', '.instance-list > .instance-item', $amount);
193
        } else {
194
            $this->assertSession()->elementsCount('css', sprintf('#%s.instance-list > .instance-item', $type), $amount);
195
        }
196
    }
197
}
198