Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Laravel Email Failer

Build Status Build status StyleCI Quality Gate Status Coverage Maintainability Rating Latest Stable Version Total Downloads License MadeWithLaravel.com shield

Laravel Email Failer

About

Trigger email failures to assert what happens on your Laravel Application when an email fails to send

Usage

Once the mailer instance is replaced, all emails will fail. This helps to assert that your application Mail exceptions are handled correctly (ie: mark the email address as invalid)

public function test_happy_path()
{
    MyService::doSomething('good');

    Mail::assertSent(MyMailable::class);
}

public function test_email_failures()
{
    $mailer = new \LaravelEmailFailer\MailFailer;
    $this->app->instance('mailer', $mailer);
    
    MyService::doSomething('wrong');

    Mail::assertNotSent(MyMailable::class);
    
    dump(Mail::failures());
    // Assert here what happens if the email has failed
}

License

Laravel Email Failer is open-sourced software licensed under the MIT license.

Icon made by Darius Dan from www.flaticon.com is licensed by CC 3.0 BY

About

Trigger email failures to assert what happens on your Laravel Application when an email fails to send

Resources

License

Languages

You can’t perform that action at this time.