Code Duplication    Length = 9-9 lines in 2 locations

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

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