Code Duplication    Length = 9-10 lines in 2 locations

src/Drupal/DrupalExtension/Context/MarkupContext.php 1 location

@@ 26-35 (lines=10) @@
23
   *
24
   * @todo this should be a trait when PHP 5.3 support is dropped.
25
   */
26
    public function getRegion($region)
27
    {
28
        $session = $this->getSession();
29
        $regionObj = $session->getPage()->find('region', $region);
30
        if (!$regionObj) {
31
            throw new \Exception(sprintf('No region "%s" found on the page %s.', $region, $session->getCurrentUrl()));
32
        }
33
34
        return $regionObj;
35
    }
36
37
  /**
38
   * Checks if a button with id|name|title|alt|value exists in a region

src/Drupal/DrupalExtension/Context/MinkContext.php 1 location

@@ 36-44 (lines=9) @@
33
   *
34
   * @return \Behat\Mink\Element\NodeElement
35
   */
36
    public function getRegion($region)
37
    {
38
        $session = $this->getSession();
39
        $regionObj = $session->getPage()->find('region', $region);
40
        if (!$regionObj) {
41
            throw new \Exception(sprintf('No region "%s" found on the page %s.', $region, $session->getCurrentUrl()));
42
        }
43
44
        return $regionObj;
45
    }
46
47
  /**