You are here

protected function EmailContext::purgeSpool 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::purgeSpool()
  2. 8.3 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  3. 8.4 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  4. 8.5 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  5. 8.6 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  6. 8.8 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  7. 10.3.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  8. 10.0.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  9. 10.1.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()
  10. 10.2.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::purgeSpool()

Purge the messages in the spool.

2 calls to EmailContext::purgeSpool()
EmailContext::disableEmailSpool in tests/behat/features/bootstrap/EmailContext.php
Revert back to the old situation (native PHP mail).
EmailContext::enableEmailSpool in tests/behat/features/bootstrap/EmailContext.php
We need to enable the spool directory.

File

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

Class

EmailContext

Namespace

Drupal\social\Behat

Code

protected function purgeSpool() {
  $filesystem = new Filesystem();
  $finder = $this
    ->getSpooledEmails();
  if ($finder) {

    /** @var File $file */
    foreach ($finder as $file) {
      $filesystem
        ->remove($file
        ->getRealPath());
    }
  }
}