tecbeast42 / laravel-codeception-email-assertions by tecbeast

This Module for codeception should enable easy assertions for emails with laravel 5.1+
9,442
2
3
Package Data
Maintainer Username: tecbeast
Maintainer Contact: kontakt@tecbeast.de (TecBeast)
Package Create Date: 2017-06-19
Package Last Update: 2020-06-19
Language: PHP
License: MIT
Last Refreshed: 2024-05-18 15:10:45
Package Statistics
Total Downloads: 9,442
Monthly Downloads: 35
Daily Downloads: 0
Total Stars: 2
Total Watchers: 3
Total Forks: 1
Total Open Issues: 0

Installation

    composer require tecbeast/laravel-codeception-email-assertions

Adapt codeceptions *.suite.yml file.

E.g.

class_name: UnitTester
modules:
    enabled:
        - Laravel5 # this is needed before EmailAssertions
        - EmailAssertions # this contains the email assertions

Assertions

All assertions will always look for the last email sent in the current test. The assertions should explain them self :).

    $I->seeEmailWasSent();
    $I->seeNoEmailWasSent();
    $I->seeEmailWasSentTo('to@domain.com');
    $I->seeEmailWasNotSentTo('from@domain.com');
    $I->seeEmailWasSentFrom('from@domain.com');
    $I->seeEmailWasNotSentFrom('to@domain.com');
    $I->seeEmailWasNotSentFrom('to@domain.com');
    $I->seeEmailContains('Hello');
    $I->seeEmailContainsNot('Laravel');