Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 291-299 (lines=9) @@
288
   * @Then (e)mail(s) has/have been sent:
289
   * @Then (e)mail(s) has/have been sent to :to:
290
   */
291
  public function mailHasBeenSent(TableNode $expectedMailTable, $to = NULL) {
292
    $expectedMail = $expectedMailTable->getHash();
293
    $matches = [];
294
    if (!is_null($to)) {
295
      $matches = ['to' => $to];
296
    }
297
    $actualMail = $this->getMail($matches);
298
    $this->compareMail($actualMail, $expectedMail);
299
  }
300
301
  /**
302
   * Check mail sent since the last step that checked mail.
@@ 307-315 (lines=9) @@
304
   * @Then new (e)mail(s) is/are sent:
305
   * @Then new (e)mail(s) is/are sent to :to:
306
   */
307
  public function newMailIsSent(TableNode $expectedMailTable, $to = NULL) {
308
    $expectedMail = $expectedMailTable->getHash();
309
    $matches = [];
310
    if (!is_null($to)) {
311
      $matches = ['to' => $to];
312
    }
313
    $actualMail = $this->getMail($matches, TRUE);
314
    $this->compareMail($actualMail, $expectedMail);
315
  }
316
317
  /**
318
   * Check all mail sent during the scenario.