You are here

public function ExampleMailTest::testForm in Swift Mailer 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/ExampleMailTest.php \Drupal\Tests\swiftmailer\Functional\ExampleMailTest::testForm()

Tests the e-mail test form.

File

tests/src/Functional/ExampleMailTest.php, line 18

Class

ExampleMailTest
@group swiftmailer

Namespace

Drupal\Tests\swiftmailer\Functional

Code

public function testForm() {
  $account = $this
    ->createUser([
    'administer swiftmailer',
  ]);
  $this
    ->drupalLogin($account);
  $this
    ->drupalPostForm(Url::fromRoute('swiftmailer.test'), [], 'Send');
  $this
    ->assertSession()
    ->pageTextContains(t('An attempt has been made to send an e-mail to @email.', [
    '@email' => $account
      ->getEmail(),
  ]));
}