ixis / codeception-drupal-mail
A Codeception module to provide Drupal mail system testing support.
Installs: 6 199
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
This package is not auto-updated.
Last update: 2020-08-21 20:17:09 UTC
README
#Drupal Mail System
Codeception module for testing the Drupal email system.
// Test to see expected number of emails sent. $I->seeNumberOfEmailsSent(1); // Clear emails from queue. $I->clearSentEmails(); // Check email fields contains text $I->seeSentEmail(array( "body" => "body contains this text", "subject" => "subject contains this text", ));
Relies on TestingMailSystem class which stores the emails in a drupal variable.
#Requirements
- Drupal 7
- The DrupalVariable codeception module.
#Install
Install using composer:
"require": {
"ixis/codeception-drupal-mail": "dev-develop"
}
#Configure
Add 'DrupalMailSystem' and 'DrupalVariable' module to the suite configuration.
class_name: AcceptanceTester
modules:
enabled:
- DrupalMailSystem
- DrupalVariable
DrupalVariable is required to read the variable that is used to temporarily store the email content.
To configure DrupalVariable see the ReadMe
##Module configuration
- 'enabled' - set to true to set the TestingMailSystem as default mail system ('mail_system')
at the beginning of the suite run and to restore it at the end. If you set this to false the module
expects you to have set this yourself.
drush vset --format=json 'mail_system' '{"default-system":"TestingMailSystem"}'