You are here

protected function AssertMailTrait::verboseEmail in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Test/AssertMailTrait.php \Drupal\Core\Test\AssertMailTrait::verboseEmail()

Outputs to verbose the most recent $count emails sent.

Parameters

int $count: Optional number of emails to output.

File

core/lib/Drupal/Core/Test/AssertMailTrait.php, line 150

Class

AssertMailTrait
Provides methods for testing emails sent during test runs.

Namespace

Drupal\Core\Test

Code

protected function verboseEmail($count = 1) {
  $mails = $this
    ->getMails();
  for ($i = count($mails) - 1; $i >= count($mails) - $count && $i >= 0; $i--) {
    $mail = $mails[$i];
    $this
      ->verbose('Email:<pre>' . print_r($mail, TRUE) . '</pre>');
  }
}