You are here

public function SwiftMailerAlterTest::testAlter in Swift Mailer 8

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

File

tests/src/Functional/SwiftMailerAlterTest.php, line 37

Class

SwiftMailerAlterTest
@group swiftmailer

Namespace

Drupal\Tests\swiftmailer\Functional

Code

public function testAlter() {
  \Drupal::state()
    ->set('swiftmailer_test_swiftmailer_alter_1', TRUE);
  \Drupal::service('plugin.manager.mail')
    ->mail('swiftmailer_test', 'test_1', 'test@example.com', \Drupal::languageManager()
    ->getDefaultLanguage()
    ->getId());
  $this
    ->assertEquals('Replace text in swiftmailer_test_swiftmailer_alter', $this->logger
    ->dump()[0]['body']);
}