You are here

protected function EmailContext::purgeSpool in Open Social 8

Same name and namespace in other branches
  1. 8.2 tests/behat/features/bootstrap/EmailContext.php \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 88

Class

EmailContext

Code

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

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