naknode's avatar

Test a markdown Mailable method

How would a unit test this Laravel method?

I have a Mailable class called ComfirmYourEmail and this method is untested. How do I test it? Cannot seem to find answer in docs.

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('mail.confirm-email');
    }
}
0 likes
4 replies
D9705996's avatar

@naknode

Is this not enough?

Not something i can really answer for you, from what you have shown you have alresdy tested that when a user registers it sends your email. What fo you hope to gain from unit tests?

naknode's avatar

@D9705996 To be able to get 100% test coverage, although I guess that's not too important if the test passes but doesn't mark it.

Please or to participate in this conversation.