tecbeast / laravel-codeception-email-assertions
This Module for codeception should enable easy assertions for emails with laravel 5.1+
Installs: 9 660
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=7.0.0
- codeception/codeception: >=2.0.0
- laravel/framework: >=5.1.0
README
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');