Code Duplication    Length = 11-12 lines in 2 locations

src/Drupal/DrupalExtension/Context/MinkContext.php 2 locations

@@ 310-321 (lines=12) @@
307
  /**
308
   * @Then I (should )see the heading :heading
309
   */
310
    public function assertHeading($heading)
311
    {
312
        $element = $this->getSession()->getPage();
313
        foreach (array('h1', 'h2', 'h3', 'h4', 'h5', 'h6') as $tag) {
314
            $results = $element->findAll('css', $tag);
315
            foreach ($results as $result) {
316
                if ($result->getText() == $heading) {
317
                    return;
318
                }
319
            }
320
        }
321
        throw new \Exception(sprintf("The text '%s' was not found in any heading on the page %s", $heading, $this->getSession()->getCurrentUrl()));
322
    }
323
324
  /**
@@ 327-337 (lines=11) @@
324
  /**
325
   * @Then I (should )not see the heading :heading
326
   */
327
    public function assertNotHeading($heading)
328
    {
329
        $element = $this->getSession()->getPage();
330
        foreach (array('h1', 'h2', 'h3', 'h4', 'h5', 'h6') as $tag) {
331
            $results = $element->findAll('css', $tag);
332
            foreach ($results as $result) {
333
                if ($result->getText() == $heading) {
334
                    throw new \Exception(sprintf("The text '%s' was found in a heading on the page %s", $heading, $this->getSession()->getCurrentUrl()));
335
                }
336
            }
337
        }
338
    }
339
340
  /**