public function EmailContext::getSpooledEmails in Open Social 8.7
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 8.3 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 8.4 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 8.5 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 8.6 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 8.8 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 10.3.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 10.0.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 10.1.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
- 10.2.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::getSpooledEmails()
Get a list of spooled emails.
Return value
Finder|null Returns a Finder if the directory exists.
Throws
Exception
2 calls to EmailContext::getSpooledEmails()
- EmailContext::findSubjectAndBody in tests/
behat/ features/ bootstrap/ EmailContext.php - Find an email with the given subject and body.
- EmailContext::purgeSpool in tests/
behat/ features/ bootstrap/ EmailContext.php - Purge the messages in the spool.
File
- tests/
behat/ features/ bootstrap/ EmailContext.php, line 52
Class
Namespace
Drupal\social\BehatCode
public function getSpooledEmails() {
$finder = new Finder();
$spoolDir = $this
->getSpoolDir();
if (empty($spoolDir)) {
throw new \Exception('Could not retrieve the spool directory, or the directory does not exist.');
}
try {
$finder
->files()
->in($spoolDir);
return $finder;
} catch (InvalidArgumentException $exception) {
return NULL;
}
}