public function EmailContext::enableEmailSpool in Open Social 8.7
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 8.3 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 8.4 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 8.5 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 8.6 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 8.8 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 10.3.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 10.0.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 10.1.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
- 10.2.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::enableEmailSpool()
We need to enable the spool directory.
@BeforeScenario @email-spool
File
- tests/
behat/ features/ bootstrap/ EmailContext.php, line 19
Class
Namespace
Drupal\social\BehatCode
public function enableEmailSpool() {
// Update Drupal configuration.
$swiftmailer_config = \Drupal::configFactory()
->getEditable('swiftmailer.transport');
$swiftmailer_config
->set('transport', 'spool');
$swiftmailer_config
->set('spool_directory', $this
->getSpoolDir());
$swiftmailer_config
->save();
// Clean up emails that were left behind.
$this
->purgeSpool();
}