You are here

ExampleMailTest.php in Swift Mailer 8

Same filename and directory in other branches
  1. 8.2 tests/src/Functional/ExampleMailTest.php

File

tests/src/Functional/ExampleMailTest.php
View source
<?php

namespace Drupal\Tests\swiftmailer\Functional;

use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;

/**
 * @group swiftmailer
 */
class ExampleMailTest extends BrowserTestBase {
  public static $modules = [
    'swiftmailer',
    'mailsystem',
  ];

  /**
   * Tests the e-mail test form.
   */
  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(),
    ]));
  }

}

Classes

Namesort descending Description
ExampleMailTest @group swiftmailer