Code Duplication    Length = 13-13 lines in 2 locations

src/SilverStripe/BehatExtension/Context/BasicContext.php 2 locations

@@ 640-652 (lines=13) @@
637
     *
638
     * @Given /^I (?:follow|click) "(?P<link>[^"]*)" in the "(?P<region>[^"]*)" region$/
639
     */
640
    public function iFollowInTheRegion($link, $region) {
641
        $context = $this->getMainContext();
642
        $regionObj = $context->getRegionObj($region);
643
        assertNotNull($regionObj);
644
645
        $linkObj = $regionObj->findLink($link);
646
        if (empty($linkObj)) {
647
			throw new \Exception(sprintf('The link "%s" was not found in the region "%s" 
648
				on the page %s', $link, $region, $this->getSession()->getCurrentUrl()));
649
        }
650
651
        $linkObj->click();
652
    }
653
654
    /**
655
     * Fills in a field in a specfic region similar to (@see iFollowInTheRegion or @see iSeeTextInRegion)
@@ 661-673 (lines=13) @@
658
     *
659
     * @Given /^I fill in "(?P<field>[^"]*)" with "(?P<value>[^"]*)" in the "(?P<region>[^"]*)" region$/
660
     */
661
    public function iFillinTheRegion($field, $value, $region){
662
        $context = $this->getMainContext();
663
        $regionObj = $context->getRegionObj($region);
664
        assertNotNull($regionObj, "Region Object is null");
665
666
        $fieldObj = $regionObj->findField($field);
667
        if (empty($fieldObj)) {
668
			throw new \Exception(sprintf('The field "%s" was not found in the region "%s" 
669
				on the page %s', $field, $region, $this->getSession()->getCurrentUrl()));
670
        }
671
672
        $regionObj->fillField($field, $value);
673
    }
674
675
676
    /**