You can make assertions against attributes configured in the build() method by calling the build() method within the assertSent closure before making the assertions:Mail::assertSent(MyMailable::class, function ($mail) { $mail->build(); return $mail->subject === 'My Subject';});感谢laohcasts上的@ohffs对此提供帮助: https://laracasts.com/discuss/channels/testing/how-to-make-assertions-on-a-laravel-mailableThanks to @ohffs on laracasts for helping with this: https://laracasts.com/discuss/channels/testing/how-to-make-assertions-on-a-laravel-mailable 这篇关于如何在Laravel Mailable上进行断言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-04 20:03