Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

A Codeception module to provide Drupal mail system testing support.

Notifications You must be signed in to change notification settings

ixis/codeception-drupal-mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

#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

#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"}'

About

A Codeception module to provide Drupal mail system testing support.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages