You are here

public function EmailContext::disableEmailSpool in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  2. 8.3 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  3. 8.4 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  4. 8.5 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  5. 8.6 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  6. 8.8 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  7. 10.3.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  8. 10.0.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  9. 10.1.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()
  10. 10.2.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::disableEmailSpool()

Revert back to the old situation (native PHP mail).

@AfterScenario @email-spool

File

tests/behat/features/bootstrap/EmailContext.php, line 35

Class

EmailContext

Namespace

Drupal\social\Behat

Code

public function disableEmailSpool() {

  // Update Drupal configuration.
  $swiftmailer_config = \Drupal::configFactory()
    ->getEditable('swiftmailer.transport');
  $swiftmailer_config
    ->set('transport', 'native');
  $swiftmailer_config
    ->save();

  // Clean up emails after us.
  $this
    ->purgeSpool();
}