You are here

public function ExampleMailTest::testForm in Swift Mailer 8.2

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

Tests the e-mail test form.

File

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

Class

ExampleMailTest
@group swiftmailer

Namespace

Drupal\Tests\swiftmailer\Functional

Code

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