Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 240-248 (lines=9) @@
237
   * @Then (e)mail(s) has/have been sent:
238
   * @Then (e)mail(s) has/have been sent to :to:
239
   */
240
  public function mailHasBeenSent(TableNode $expectedMailTable, $to = NULL) {
241
    $expectedMail = $expectedMailTable->getHash();
242
    $matches = [];
243
    if (!is_null($to)) {
244
      $matches = ['to' => $to];
245
    }
246
    $actualMail = $this->getMail($matches);
247
    $this->compareMail($actualMail, $expectedMail);
248
  }
249
250
  /**
251
   * Check mail sent since the last step that checked mail.
@@ 256-264 (lines=9) @@
253
   * @Then new (e)mail(s) is/are sent:
254
   * @Then new (e)mail(s) is/are sent to :to:
255
   */
256
  public function newMailIsSent(TableNode $expectedMailTable, $to = NULL) {
257
    $expectedMail = $expectedMailTable->getHash();
258
    $matches = [];
259
    if (!is_null($to)) {
260
      $matches = ['to' => $to];
261
    }
262
    $actualMail = $this->getMail($matches, TRUE);
263
    $this->compareMail($actualMail, $expectedMail);
264
  }
265
266
  /**
267
   * Check all mail sent during the scenario.