7 months ago

Mail test not passing

Posted 7 months ago by successdav

I am following up a laracast video on sending mails but my test is not passing...

My test class

use DatabaseMigrations;
    /** @test */
    public function a_comfirmation_email_is_sent_upon_registration()
        event(new Registered(create('App\User')));

        Mail::assertSent(PleaseConfirmYourEmail ::class);

Event Service Provider Class

 protected $listen = [
        'App\Events\ThreadHasNewReply' => [

        Registered::class => [

My SendEmailConfirmationRequest Class

   public function handle(Registered $event)
        Mail::to($event->user)->send(new PleaseConfirmYourEmail());

and when I run this test it just returns

1) Tests\Feature\RegistrationTest::a_comfirmation_email_is_sent_upon_registration
The expected [App\Mail\PleaseConfirmYourEmail] mailable was not sent.
Failed asserting that false is true.

Please sign in or create an account to participate in this conversation.