Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 695-707 (lines=13) @@
692
     *
693
     * @Given /^I (?:follow|click) "(?P<link>[^"]*)" in the "(?P<region>[^"]*)" region$/
694
     */
695
    public function iFollowInTheRegion($link, $region)
696
    {
697
        $context = $this->getMainContext();
698
        $regionObj = $context->getRegionObj($region);
699
        assertNotNull($regionObj);
700
701
        $linkObj = $regionObj->findLink($link);
702
        if (empty($linkObj)) {
703
            throw new \Exception(sprintf('The link "%s" was not found in the region "%s" 
704
				on the page %s', $link, $region, $this->getSession()->getCurrentUrl()));
705
        }
706
707
        $linkObj->click();
708
    }
709
710
    /**
@@ 717-729 (lines=13) @@
714
     *
715
     * @Given /^I fill in "(?P<field>[^"]*)" with "(?P<value>[^"]*)" in the "(?P<region>[^"]*)" region$/
716
     */
717
    public function iFillinTheRegion($field, $value, $region)
718
    {
719
        $context = $this->getMainContext();
720
        $regionObj = $context->getRegionObj($region);
721
        assertNotNull($regionObj, "Region Object is null");
722
723
        $fieldObj = $regionObj->findField($field);
724
        if (empty($fieldObj)) {
725
            throw new \Exception(sprintf('The field "%s" was not found in the region "%s" 
726
				on the page %s', $field, $region, $this->getSession()->getCurrentUrl()));
727
        }
728
729
        $regionObj->fillField($field, $value);
730
    }
731
732